#include
#define N 40
using namespace std;
int Read(int score[])//录入学生成绩,直到-1为止
{
int i=-1;
do{
i++;
cout<<"Input score:"<
}while(score[i]>=0);
return i;
}
int Average(int score[],int n)//计算平均成绩
{
int i,sum=0;
for(i=0;i
sum+=score[i];
}
return sum/n;
}
int findMax(int score[],int n)//找到最大成绩
{
int max,i;
max=score[0];
for(i=1;i
if(score[i]>max) max=score[i];
}
return max;
}
int findMin(int score[],int n)//找到最小成绩
{
int min,i;
min=score[0];
for(i=1;i
if(score[i]
return min;
}
int main()
{
int score[N],aver,n,max,min;
n=Read(score);
cout<<"Total student are:"<
cout<<"The average is:"<
cout<<"The Max is:"<
cout<<"The Min is:"<
}