#include <stdio.h>
#include <stdlib.h>
#define N 40
int ReadScore(int score[]);
int LowScore(int score[] ,int n);
main()
{
int n,score[N],count;
n = ReadScore(score);
printf("total students are %dn",n);
count = LowScore(score , n);
printf("the students of low score are %dn",count);
}
int ReadScore(int score[])
{
int i = -1;
do{
i++ ;
printf("input score: ");
scanf("%d",&score[i]);
}while(score[i] >= 0 && score[i] <=100);
return i ;
}
int LowScore(int score[] ,int n)
{
int i , count = 0;
for(i = 0 ; i < n ; i++)
{
if(score[i] < 60)
count ++ ;
}
return count ;
}
最后
以上就是自由小懒虫最近收集整理的关于C程序--输入某班学生某课程成绩,用函数统计不及格人数的全部内容,更多相关C程序--输入某班学生某课程成绩内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复