主题:求助,刚学编程碰到问题啦
#include<stdio.h>
void main()
{int x;
float grade;
printf("please enter a grade:");
scanf("%lf",&grade);
x=int(grade/10);
switch(x)
{case 9:printf("A\n");break;
case 8:printf("B\n");break;
case 7:printf("C\n");break;
case 6:printf("D\n");break;
case 5:
case 4:
case 3:
case 2:
case 1:printf("E\n");break;
}
}
为什么没有输出呢?
void main()
{int x;
float grade;
printf("please enter a grade:");
scanf("%lf",&grade);
x=int(grade/10);
switch(x)
{case 9:printf("A\n");break;
case 8:printf("B\n");break;
case 7:printf("C\n");break;
case 6:printf("D\n");break;
case 5:
case 4:
case 3:
case 2:
case 1:printf("E\n");break;
}
}
为什么没有输出呢?