ZKX's LAB

从键盘输入学生和分数 从键盘输入30名学生的成绩数据,求其中的最高分、最低分和平均分。

2021-04-23知识4

从键盘输入学生成绩,判断并输出学生成绩等级.(用if-else语句) include?printf(\"请输入成绩:\\n\");float?score;scanf(\"%f\",&score);if(score>;90)printf(\"A\");else?if(score>;80)printf(\"B\");else?printf(\"C\");

编写程序,从键盘输入某学生的三科成绩,求出总分和平均分,找出最高分和最低分. includemain(){ int score[3],max,min,sum=0,i;float ave;printf(\"input three scores of the student:\");for(i=0;i

C语言怎样编程用键盘输入学生的分数,并求平均分和不及格人数? #includeincludeint main(int argc,char*argv[]){num代表总人数,score用于记录当前输入的分数,sum记录总分,average记录平均分,failed记录不及知格人数,所有分道数都定为“整数”。int num=0,score=0,sum=0,average=0,failed=0;do{版scanf(\"%d\",&score);if(score>;=0){sum+score;大于0的数,累加权num+;大于0的计数if(score)failed+;不及格的计数}}while(score>;=0);score大于0,继续循环;否则终止average=sum/num;平均值printf(\"平均分:%d 不及格的人数:%d\",average,failed);return 0;}

#键盘分数怎么输入#手机键盘怎么输入分数#电脑键盘上怎么输入分数符号#电脑键盘输入分数#从键盘输入学生和分数

随机阅读

qrcode
访问手机版