【问题标题】:How do I write this equation in c++ [closed]我如何在 C++ 中编写这个等式 [关闭]
【发布时间】:2017-02-20 17:04:15
【问题描述】:

我想出的是: 付款 = (rate * (1.0 + rate) * pow(madepayments)) / ((1.0 + rate) * pow(madepayments) -1.0) * loan

它告诉我“没有重载函数 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;

【问题讨论】:

  • 图片是随它一起贴出来的吗?我不知道,这是我第一次使用该网站。
  • 请出示您的代码。
  • { 双倍利率、付款、贷款、已付款、姓名、还款、已付利息; cout > 贷款; cout > 率; cout > 已付款; cout > 名称;付款 = (rate * (1.0 + rate) * pow(madepayments)) / ((1.0 + rate) * pow(madepayments) - 1.0) * loan;
  • 编辑您的问题并添加代码。
  • 你认为pow 函数有什么作用?

标签: c++ equation


【解决方案1】:

Pow 需要另一个参数来描述指数。

【讨论】:

    猜你喜欢
    • 2023-04-07
    • 1970-01-01
    • 1970-01-01
    • 2023-04-03
    • 1970-01-01
    • 1970-01-01
    • 2016-02-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多