提交时间:2019-10-16 15:34:50

运行 ID: 1630

#include <iostream> int main() { int a,b; scanf("%d %d",&a,&b); double sum; int i; sum=b,i=1; if(a==1){ sum=sum+sum*2.25*0.01; printf("合计为%.6lf",sum); } else if(a==2){ while(i<=2){ sum=sum+sum*2.43*0.01; i=i+1; } printf("合计为%.6lf",sum); } else if(a==3){ while(i<=3){ sum=sum+sum*2.7*0.01; i=i+1; } printf("合计为%.6lf",sum); } else if(a==4){ while(i<=4){ sum=sum+sum*2.88*0.01; i=i+1; } printf("合计为%.6lf",sum); } else if(a==5){ while(i<=5){ sum=sum+sum*3*0.01; i=i+1; } printf("合计为%.6lf",sum); } return 0; }