#include <iostream>
using namespace std;
float bbb(float c,float a,int b) //定义的小函数用来计算
{
int i;
for(i=0;i<b;i++)
c=c+c*a;
return c;
}
class yinhang{
public:
yinhang(float x,int y,float z)
{
rmb=x;shijian=y;lilv=z;
}
float Rmb(){
return bbb( rmb,lilv,shijian);
};
private:
float lilv;
float rmb;
int shijian;
};
int main()
{
int RMB,SHIJIAN;
float LILV;
cout<<"请输入本金.年份.年利率:"<<endl;
cin>>RMB>>SHIJIAN>>LILV;
yinhang Yinhang(RMB,SHIJIAN,LILV);
cout<<"本息共计:"<<endl;
cout<<Yinhang.Rmb();
}