#include<stdio.h>
#include <stdlib.h>
#include<math.h>
double futurelnvestmentValue(double investmentAmount,double monthlyInterestRate,int years);
int main()
{
double investmentAmount,yearlyInterestRate,years,monthlyInterestRate;
scanf("%lf,%lf,%lf",&investmentAmount,&yearlyInterestRate,&years);
for(years=1;years<=6;years++)
{
printf("%d\n",futurelnvestmentValue);
}
return 0;
}
double futurelnvestmentValue(double investmentAmount,double monthlyInterestRate,int years)
{
int yearlyInterestRate;
monthlyInterestRate=yearlyInterestRate/12;
futurelnvestmentValue=investmentAmountpow((1+monthlyInterestRate),(years12));
return futurelnvestmentValue;
}
编码哪里错了
若函数futureInvestmentValue( )用于计算投资的未来投资值,并且它的函数原型如下:double futurelnvestmentValue(double investmentAmount,
double monthlyInterestRate, int years);
●investmentAmount
投资额
monthlyInterestRate
月利率
●year
投资年限
, 未来投资额=投资额x(1 +月利率)年数x12