#用switch break的语句计算银行利率 C语言 不知道哪里错了 vs2010不能运行
#include<stdio.h>
int main()
{
int choice;
double y;
printf(" 1---活期\n");
printf(" 2---一年期\n");
printf(" 3---三年期\n");
printf(" 4---五年期\n");
printf("Please input choice[1-4]: ");
scanf("%d", &choice);
switch(choice)
{
case 1:
y=100*(1+0.00361);
break;
case 2:
y=100(1+0.02251);
break;
case 3:
y=100(1+0.03333);
break;
case 4:
y=100(1+0.0360*5);
break;
default:
printf("对不起,您的选择有误!");
return;
}
printf("100元到期本金及利息总和:%f\n",y);
printf("谢谢!\n");
return 0;
}