define a 5Line3A two-dimensional array of columns, each representing a student's high number, English,C + +Achievements. And then define a 5one-dimensional array of elements that are used to store each student'saverage score. Please enter the student's course scores, output a transcript with an average score, and an average of all student averages.
The code is as follows:
#include <iostream> #include <iomanip>using namespace Std;int main () { int score[5][3]; Double average[5]; int i,j; Double sum=0; for (i=0; i<5; i++) for (j=0; j<3; j + +) cin>>score[i][j]; for (i=0; i<5; i++) average[i]=0; For (i=0, i<5; i++) {for (j=0; j<3; j + +) average[i]+=score[i][j]; average[i]=average[i]/3.0; Sum+=average[i]; } For (i=0, i<5; i++) {for (j=0; j<3; j + +) cout<<score[i][j]<< ""; Cout<<setiosflags (ios::fixed) <<setprecision (2) <<average[i]<<endl; } Cout<<setiosflags (ios::fixed) <<setprecision (2) <<sum/i<<endl; return 0;}
Operation Result:
18th Week OJ Test Project 3--array score statistics