#include
using namespace std;
int main()
{
const double RATE=6.9;
double deposit;
cout<<"Enter the amount of your deposit $";
cin>>deposit;
double newBalance;
newBalance=deposit+deposit*(RATE/100);
cout<<"In one year,that deposit will grow to\n"
<<"$"<
return 0;
}
这样就可以了。
写个getchar(),或者 system("pause") ,后者要带 #include
cin.get(); // 不行就多加几个。
return 0;
}
#include
#include
using namespace std;
int main()
{
const double RATE=6.9;
double deposit;
cout<<"Enter the amount of your deposit $";
cin>>deposit;
double newBalance;
newBalance=deposit+deposit*(RATE/100);
cout<<"In one year,that deposit will grow to\n"
<<"$"<
return 0;
}
在需要停的地方加一句System("pause");就好了..