如何用c ++编写这个等式

时间:2017-02-20 17:04:16

标签: c++ equation

我想出的是: 付款=(费率*(1.0 +费率)* pow(已付款))/((1.0 +费率)* pow(已付款)-1.0)*贷款

它告诉我“没有重载函数pow的实例匹配参数列表。参数类型:double

代码:

double rate, payment, loan, madepayments, name, paidback,interestpaid;    

cout << "Enter the loan amount: "; 
cin >> loan; 
cout << "Enter the annual interest rate: "; 
cin >> rate; 
cout << "Enter the number of payments made: "; 
cin >> madepayments; 
cout << "Enter the customer's name: "; 
cin >> name; 
payment = (rate * (1.0 + rate) * pow(madepayments)) / ((1.0 + rate) * pow(madepayments) - 1.0) * loan;

1 个答案:

答案 0 :(得分:2)

Pow期望另一个描述指数的参数。