C语言程序没有错误,但显现出错
#include<stdio.h>void main()
{
float s;
int grade;
scanf("%d",s);
do
{
printf("\n输入的分数有错误");
}
while(s>100||s<0);
switch((int)(s/10))
{
case 10:grade='A';break;
case 9:grade='B';break;
case 8:grade='C';break;
case 7:grade='D';break;
case 6:
case 5:
case 4:
case 3:
case 2:
case 1:
case 0:grade='E';break;
}
printf("成绩是%5.1f,相应等级是%c\n",s,grade);
这是我写的程序,用2010编译的,没有语法错误。只不过编译的时候出现这个对话框