#include<stdio.h>
int main()
{
float grade;
printf("请输入你的成绩:\n",grade);
scanf("%f",&grade);
if(grade>100||grade<0)
{
printf("输入错误,请重新输入!\n");
}
else{
printf("你的成绩等级是:");
if(grade>=85&&grade<=100)
{
printf("A\n");
}
else if(grade>=75&&grade<85)
{
printf("B\n");
}
else if(grade>=60&&grade<75)
{
printf("C\n");
}
else
{
printf("D\n");
}
return 0;
}
}
int main()
{
float grade;
printf("请输入你的成绩:\n",grade);
scanf("%f",&grade);
if(grade>100||grade<0)
{
printf("输入错误,请重新输入!\n");
}
else{
printf("你的成绩等级是:");
if(grade>=85&&grade<=100)
{
printf("A\n");
}
else if(grade>=75&&grade<85)
{
printf("B\n");
}
else if(grade>=60&&grade<75)
{
printf("C\n");
}
else
{
printf("D\n");
}
return 0;
}
}