提交时间:2019-10-19 13:21:10

运行 ID: 1745

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