设本金是10000元年利率为10%求三年后的复利终值是多少

来源:百度知道 编辑:UC知道 时间:2024/07/04 21:16:04

F=A*(1+10%)^3
结果为:13310元。

13310元

#include<iostream>
using std::cout;
using std::endl;
using std::fixed;

#include<cmath>
using std::pow;

#include<iomanip>
using std::setw;
using std::setprecision;

int main()
{
double amount;
double principal=10000.0;
double rate=0.1;
double interest;

interest=1.0+rate;

cout<<"Year"<<setw(21)<<"Amount on deposit"<<endl;

cout<<fixed<<setprecision(2);

for(int year=1;year<=3;year++)
{
amount=principal*pow(interest,year);

cout<<setw(4)<<year<<setw(21)<<amount<<endl;
}

return 0;
}