提交时间:2019-10-11 21:32:48

运行 ID: 1494

#include<iostream> int main(){ int qx; float bj,a; scanf("%d %f",&qx,&bj); if(qx==1){ a=bj+bj*0.0225; printf("合计为%f",a); } if(qx==2){ a=bj+(bj*0.0243)+((bj+bj*0.0243)*0.0243); printf("合计为%f",a); } if(qx==3){ a=bj+(bj*0.0270)+((bj+bj*0.0270)*0.0270)+(((bj+bj*0.0270)*0.0270+bj)*0.0270); printf("合计为%f",a); } if(qx==4){ a=bj+(bj*0.0288)+((bj+bj*0.0288)*0.0288)+(((bj+bj*0.0288)*0.0288+bj)*0.0288)+((((bj+bj*0.0288)*0.0288+bj)*0.0288+bj)*0.0288); printf("合计为%f",a); } if(qx==5){ a=bj+(bj*0.0300)+((bj+bj*0.0300)*0.0300)+(((bj+bj*0.0300)*0.0300+bj)*0.0300)+((((bj+bj*0.0300)*0.0300+bj)*0.0300+bj)*0.0300)+(((((bj+bj*0.0300)*0.0300+bj)*0.0300+bj)*0.0300+bj)*0.0300); printf("合计为%f",a); } return 0; }