// program assignment 2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include "math.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
double percentconverter;
int playerinput;
int years;
double intrates;
double answer;
cout << " Enter initial amount:" << endl;
cin >> playerinput;
cout << "Enter number of years:" << endl;
cin >> years;
cout << "Enter interest rate (percent per year):" << endl;
cin >> percentconverter;
intrates = percentconverter / 100;
answer = playerinput * (1 + intrates) ^ years;
return 0;
}
行“答案 = playerinput * (1 + inrates) ^ years;” 我在 playerinput 下面有一条小红线,它表示指向函数的指针……我不明白你得到那个错误,也是我的任务“编写一个程序来计算如果你最终会得到多少钱你以固定利率投资一笔钱,每年复利一次。” 我有足够信心的方程式是正确的,当我运行完成的程序时,它会按照应有的方式运行,如果我在方程式中错了,请随时留下反馈。谢谢你