...输出成绩ABCDE,90分以上为A80~90为B,70~79为C,60~69为D,60一下为E...
发布网友
发布时间:2024-10-02 18:55
我来回答
共4个回答
热心网友
时间:2024-11-08 23:41
#include<stdio.h>
int main()
{
int F;
printf("输入成绩:\n");
scanf("%d",&F);
if(F>60)
{
if(F>70)
{
if(F>80)
{
if(F>90)
printf("A");
else
printf("B");
}
else
printf("C");
}
else
printf("D");
}
else
printf("E");
}
热心网友
时间:2024-11-08 23:40
#include<stdio.h>
int main()
{
double n;
scanf("%lf",&n);
switch((int)n/10)
{
case 10:
case 9:
printf("A\n");
break;
case 8:
printf("B\n");
break;
case 7:
printf("C\n");
break;
case 6:
printf("D\n");
break;
default:
printf("E\n");
break;
}
return 0;
}
热心网友
时间:2024-11-08 23:35
看错了 呵呵
热心网友
时间:2024-11-08 23:36
#include<stdio.h>
main()
{int score,grade;
char A , B , C , D , E, grade;
printf("input score");
scanf("%d",&score);
grade=score/10;
switch(grade)
{
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:grade='E';
case 6:grade='D';
case 7:grade='C';
case 8:grade='B';
case 9:grade='A';
}
printf("%c",grade);
}