编辑代码

#include <stdio.h>
int main () {
    //JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。 
	int m;
    float c,r,money;
    printf("存款金额与期限:");
	scanf("%f%d",&c,&m);
    switch(m)
    {
    case 4: r=0.02;break;
    case 8: r=0.03;break;
    case 12:r=0.04;break;
    case 32:r=0.05;break;
   }
money=c+c*r*m/12;
printf("%f",money);
}