求助中 不知道哪里有错 谢谢了
程序代码:
#include<stdio.h> #define N 40 int readscore(int score[]); int compare(int score[],int i); int main() { int score[N] ; readscore(score); printf("学生总数是%d\n",readscore(score)); compare(score,readscore(score)); printf("不及格人数是%d",compare(score,readscore(score))); return 0; } /*函数功能:读取成绩,返回学生人数。*/ int readscore(int score[]) { printf("输入学生成绩\n"); int n=-1; do { n++; scanf("%d",&score[n]); }while(score[n]>=0); return n; } /*函数功能:累加不及格的人数。*/ int compare(int score[],int i) { i=0; do { if(score[i]>=0&&score[i]<60) i++; else continue; }while(i<=readscore(score)); return i; }