switch的问题,求指点!!!!!!!!!!!!!!!!
#include"stdafx"main()
{
int a,b;
scanf("%f",a);
b=int(a/10);
switch(b)
case'10':grade='A';
case'9':grade='A';
case'8':grade='B';
case'7':grade='C';
case'6':grade='D';
default:grade='E';
printf("%c",grade);
getchar();
}
好像有问题
#include"stdafx.h"
main()
{
float a;
char grade;
scanf("%f",a);
if((a>90)&&(a<=100)) grade='A';
else if(a>80) grade='B';
else if(a>70) grade='C';
else if(a>60) grade='D';
else if((a>=0)&&(a<=60)) grade='E';
printf("成绩是:%c",grade);
return 0;
}这个也有问题!!!!!