❶ 用c语言编写一个程序,输入一个成绩,判断该成绩是否及格。
#include"stdio.h"
intmain()
{
intscore;
printf("请输入一个成绩:");
scanf("%d",&score);
if(score>60&&score<=100)
printf("成绩合格 ");
elseif(score<60&&score>=0)
printf("成绩不合格 ");
else
printf("输入的成绩有误 ");
}
❷ 如何用C语言输出考试成绩的优秀,良好,及格,不及格
#include <stdio.h>void main(){int score;scanf("%d",&score);//输入成绩if(score>=90) printf("优秀");else if(score>=70&&score<90) printf("良好");else if(score>=60&&score<70) printf("及格");else if(score<60) printf("不及格!");}
❸ 跪求C语言大神,任意输入一个成绩,给出评语,90~100优秀,80~89良好,60~79及格,0~
#include"stdio.h"
intmain(void){
char*lev[11]={"不及格","不及格","不及格","不及格","不及格",
"不及格","及格","及格","良好","优秀","优秀"},sco;
while(1){
printf("Pleaseenterthescores(int0~100)... ");
if(scanf("%d",&sco)&&sco>=0&&sco<=100)
break;
fflush(stdin);
printf("Error,redo:");
}
printf("%d<-->%s ",sco,lev[sco/10]);
return0;
}
❹ c语言编程 统计学生成绩 60及格 及格人数与不及格人数
#include<stdio.h>
intmain()
{
intt,r=0,i;
floats;
printf("请输入总人数:");
scanf("%d",&t);
printf("请输入%d个分数:",t);
for(i=0;i<t;i++)
{
scanf("%f",&s);
if(s>=60)r++;
}
printf("及格人数%d,不及格人数%d ",r,t-r);
}