#include <iostream>
using namespace std;
int main()
{
int i;
double a,b,f,d,c,g,r,o,p;
cout<<"请选择存款类型:定期存款请按1;活期存款请按2.";
cin>>a;
if (a==1)
{
cout<<"请输入存款金额:"<<endl;
cin>>b;
cout<<"请输入存款期限,以年为单位"<<endl;
cin>>f;
d=0.1;
c=b*d*f;
cout<<"您的利息为:"<<c<<"元"<<endl;
}
else
cout<<"请输入存款金额:"<<endl;
cin>>o;
cout<<"请输入您的存款期限,以月为单位:"<<endl;
cin>>g;
if (g=1)
i=0;
else if (g=3)
i=1;
else if (g=6)
i=2;
else if (g=12)
i=3;
else if (g=24)
i=4;
else if (g=36)
i=5;
else if (g=60)
i=6;
switch (i)
{
case 0:r=0.005;break;
case 1:r=0.031;break;
case 2:r=0.033;break;
case 3:r=0.035;break;
case 4:r=0.044;break;
case 5:r=0.05;break;
case 6:r=0.055;break;
}
p=r*o*g;
cout<<"您的利息为:"<<p<<"元";
return 0;
}
利息计算器
最新推荐文章于 2024-03-23 22:36:06 发布