我编了这样一个程序:编译成功,没有bug。
但问题是运行时屏幕显示:Enter the number of your deposit $
我输入一个数据之后,接着按Enter,屏幕就关闭了。我应该怎样解决?
新手上路,请多关照
#include<iostream>
using namespace std;
int main()
{
const double RATE=6.9;
double deposit;
cout<<"Enter the number of your deposit $";
cin>>deposit;
double newBalance;
newBalance=deposit+deposit*(RATE/100);
cout<<"In one year,that deposit will grow to"
<<endl
<<"$"<<newBalance<<"an amount worth waiting for."
<<endl;
getchar();
return 0;
}