close

#include <iostream>
#include <string>
#include<math.h>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
float r,y,money,yearOfAmount;
cout<<"輸入本金"; 
cin>>money;
cout<<"輸入年利率"; 
cin>>r;
cout<<"輸入年限";
cin>>y;
for(int i=1;i<=y;i++){
yearOfAmount=money*pow(1+r/100,i);
cout<<yearOfAmount<<endl;
    
}

return 0;
}

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 學習程式 的頭像
    學習程式

    程式學習日記,如果我幫助了你請讓我知道

    學習程式 發表在 痞客邦 留言(0) 人氣()