我使用了 Visual Studio 2012,这是我第一次使用它。我开始了
NEW→<kbd>Project-Empty→<kbd>Project-sourcethen files-add→<kbd>new items-Cpp文件并输入以下代码:
#include <iostream>
using namespace std;
int main()
{
int cents;
int dollars, quarters, dimes, nickels, pennies;
cout << "Enter total cents: ";
cin >> cents;
dollars = cents / 100;
cents = cents - dollars*100;
quarters = cents / 25;
cents = cents - quarters*25;
dimes = cents / 10;
cents = cents - dimes*10;
nickels = cents / 5;
cents = cents - nickels*5;
pennies = cents;
cout << "This corresponds to "
<< dollars << " dollars, "
<< quarters << " quarters, "
<< dimes << " dimes, "
<< nickels << " nickels, and "
<< pennies << " pennies.\n\n";
return 0;
}
我想编写一个程序将美分分解为dollars
、quarters
、和nickels
,窗口已成功形成,但在我输入美分数后,我想转换的窗口消失了。断点或系统(“暂停”)似乎不起作用。这是消息:dimes
pennies
.exe
'Project2.exe' (Win32): Loaded 'C:\Users\dell\Documents\Visual Studio 2012\Projects\Project2\Debug\Project2.exe'. Symbols loaded. 'Project2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file. 'Project2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file. 'Project2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file. 'Project2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp110d.dll'. Symbols loaded. 'Project2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr110d.dll'. Symbols loaded. The thread 0xe24 has exited with code -1073741749 (0xc000004b). The program '[7476] Project2.exe' has exited with code -1073741510 (0xc000013a).
如何保留.exe
窗口并查看结果?