新手求助,为什么运行不了这串代码#include <stdi
c语言吧
全部回复
仅看楼主
level 3
瞌睡wang 楼主
新手求助,为什么运行不了这串代码[泪][泪]
#include <stdio.h>
#include <math.h>
int main()
{
int I,S;
double T;
T=0;
scanf("%d",&I);
S=I/100000;
switch(S);
{case 0: T=I*(1+0.1);break;
case 1: T=(I-100000)*0.075+100000*0.1+I;break;
case 2:
case 3: T=100000*0.075+100000*0.1+(I-200000)*0.05;break;
case 4:
case 5: T=100000*0.075+100000*0.1+200000*0.05+(I-400000)*0.03;break;
case 6:
case 7:
case 8:
case 9: T=100000*0.075+100000*0.1+200000*0.05+200000*0.03+(I-600000)*0.015;break;
case 10: T=100000*0.075+100000*0.1+200000*0.05+200000*0.03+400000*0.015+(I-1000000)*0.01;break;
}
printf("奖金=%lf\n",T);
return 0;
}
总是报错illegal case 和illegal break
2019年10月16日 15点10分 1
1