提交时间:2019-10-19 13:15:56

运行 ID: 1742

#include<iostream> int main(){ int a,y=1; double n,m; scanf("%d %lf",&a,&m); switch(a){ case 1:n=2.25*0.01;break; case 2:n=2.43*0.01;break; case 3:n=2.7*0.01;break; case 4:n=2.88*0.01;break; case 5:n=3*0.01;break; default:n=1; } while(y<=a){ m=m*(1+n); y++; } printf("合计为%.6lf",m); return 0; }