/*
*copyright (c) 2014, College of Computer Science, Yantai University
*all rights reserved.
* File name: Array statistics score
* Wangzhong
* Completion Date: 2014.11.23
* Version Number: v1.0
*
* Problem Description: Enter the number of students, and enter the student scores, the highest score, the lowest score, the average score, study number
* Input Description: Number of students, score
* Program output: Highest score, lowest score, average score, school number
#include <iostream>using namespace Std;int main () {int score[50]; int num,i,sum=0,max=-1,min=999, average; cout<< "How many students are there in the group?" "; cin>>num; cout<< "Please enter student scores:" <<endl; for (i=0; i<num; i++) {cout<< "Please enter the" <<i<< "Students results:"; cin>>score[i]; } for (i=0; i<num; i++) {sum+=score[i]; if (Max<score[i]) max= score[i]; if (min>score[i]) min = score[i]; } sum=score[i]+sum;average=sum/num;cout<< "Highest score:" <<max<< ";cout<<" Minimum score: "<<min << ";cout<<" average score: "<<average<<endl;int x=0,s=0;for (i=0;i<num;i++) {if (Max==score[i]) x + +; if (Min==score[i]) s++;} cout<< "Highest scores have" <<x<< "people," << "Their study number is:"; for (i=0;i<num;i++) if (Max==score[i]) cout<<i << ""; cout<< "min" <<s<< "People" << "Their study number is:"; for (i=0;i<num;i++) if (min==score[i]) cout<<i<< ""; return 0;}
13 weeks (Array stats score)