错误C2064:术语不评估为采用1个参数的函数
我试图检查几乎所有内容,包括double和int定义但我一直收到此错误。我检查了有关此错误的其他问题,但我找不到任何东西。如果你们能帮助我那会很棒。
// Bonus.cpp : main project file.
#include "stdafx.h"
#include <iostream>
#include <cmath>
using namespace System;
using namespace std;
double Per_Pay(double L, double r, double m, double t);
double After_Pay(double L, double r, double m, double t, double k);
int main()
{
int L,m,t,k;
double r;
cout << "Please input the values of L (the loan amount), r (the doubleerest rate per year),\nm (the number of paymenst in a year), t (how many years the loan is for), and\nk (the amount of payments that have been made).\n\n";
cin >> L >> r >> m >> t >> k;
cout << "The amount to be payed each time is $" << Per_Pay(L,r,m,t) << " and the amount to be payed after " << k << " amount of payments is $" << After_Pay(L,r,m,t,k) << endl;
return 0;
}
double Per_Pay(int L, double r, int m, int t)
{
double R,i;
i=(r/m);
R=(L*i)/(1-(pow((1+i),(-m*t))));
return R;
}
double After_Pay(int L, double r, int m, int t, int k)
{
double R,L_prime,i;
i=(r/m);
R=(L*i)/(1-(pow((1+i),(-m*t))));
L_prime=R((1-(pow((1+i),(-m*t))))/i);
return L_prime;
}
答案 0 :(得分:1)
double R,L_prime,i;
//....
L_prime=R((1-(pow((1+i),(-m*t))))/i);
让我们进一步削减它:
double R, L_prime;
L_prime=R(whatever);
问题相当明显。 R
是变量,而不是函数。更有趣的是你希望这段代码能做什么。