慕无忌4368783
2018-10-09 11:36
#include "stdio.h"
main()
{
char grade;
printf("\ninput grade:");
scanf("%f",&grade);
grade=grade/=10;
switch(grade)
{
case 10:
case 9:printf("\n A");break;
case 8:printf("\n B");break;
case 7:printf("\n C");break;
case 6:printf("\n D");break;
default:printf("\n E");break;
}
}
char 不是单个字符吗? %f 不是单浮点标量吗,,,,
#include<stdio.h>
main()
{
int grade;
printf("\ninput grade:");
scanf("%d",&grade);
grade=int(grade/10);
switch(grade)
{
case 10:
case 9:printf("\n A");break;
case 8:printf("\n B");break;
case 7:printf("\n C");break;
case 6:printf("\n D");break;
default:printf("\n E");break;
}
}
C语言入门
926028 学习 · 20793 问题
相似问题