讨论/技术交流/在VS中为什么不能运行?,但在VC6中就能运行/
在VS中为什么不能运行?,但在VC6中就能运行

#include<cmath>
using namespace std;

int main()
{
double sum, year, n, reat;
cout << "请输入依次本金,存款年限,年利率,用空格隔开" << endl;
cin >> n >> year >> reat;
while (n > 0)
{
sum = n * pow((1 + reat), year);
cout << "本息共为" << sum << endl;
cout << "请输入依次本金,存款年限,年利率,用空格隔开" << endl;
cin >> n >> year >> reat;
}
return 0;
}

![1 20200524104950.png](https://pic.leetcode-cn.com/e4fba50f560151c481b853f65fd417b655edcb1202c4f4e13aca7df0ed007575-1%2020200524104950.png)

1 20200524104950.png

共 1 个回复

。。。你忘记 #include <iostream> 了
-3e2b3a3d0777a3dd.jpg