c语言编程,根据分数划分成绩#include "stdio.h"#include "conio.h"void main(){int score;scanf("%d,&score");if(score60 || score==60) && score70 || score==70) && score80 || score==80) && score
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/27 17:23:03
c语言编程,根据分数划分成绩#include "stdio.h"#include "conio.h"void main(){int score;scanf("%d,&score");if(score60 || score==60) && score70 || score==70) && score80 || score==80) && score
c语言编程,根据分数划分成绩
#include "stdio.h"
#include "conio.h"
void main()
{
int score;
scanf("%d,&score");
if(score60 || score==60) && score70 || score==70) && score80 || score==80) && score
c语言编程,根据分数划分成绩#include "stdio.h"#include "conio.h"void main(){int score;scanf("%d,&score");if(score60 || score==60) && score70 || score==70) && score80 || score==80) && score
#include
main()
{
int score;
printf("输入分数:\n");
scanf("%d",&score);
score=score/10;
switch(score)
{
case 10:
case 9:printf("the score is A\n");break;
case 8:printf("the score is B\n");break;
case 7:printf("the score is C\n");break;
case 6:printf("the score is D\n");break;
case 5:
case 4:
case 3:
case 2:
case 1:
case 0:printf("the score is E\n");break;
defaule:printf("Input error");
}
}
另外我想说,用
if
else if
句式时
else if表示当之前if条件不成立时再进行判断,
例如
if(score