The problem is some compilers are different. At the end on the main function try adding this. For me the window opens and closes, so I think the basic solution would be adding this:
cin.get();
Edit: Using <windows> would be useless and just add to the filesize as the program is using nothing from the Windows API