### 输入

15个整数，表示5名学生3科的成绩

97 78 87
78 63 68
73 81 85
91 87 88
76 81 89

97 78 87 87.33
78 63 68 69.67
73 81 85 79.67
91 87 88 88.67
76 81 89 82.00
81.47

### 提示

#include<iostream>
#include <iomanip>
using namespace std;
int main()
{
int score[5][3]; //保存成绩的数组
double average[5]; //保存平均成绩的数组
int i,j;
//输入成绩
for(i=0; i<5; i++)
for(j=0; j<3; j++)
cin>>score[i][j];
//计算每位同学的平均成绩，保存到数组average中

//输出带平均成绩的成绩单

//计算平均成绩的平均值并输出

return 0;
}

### 代码如下

``````#include<iostream>
#include <iomanip>
using namespace std;

int main()
{
int score[5][3];
double average[5];
int i,j;
for(i=0; i<5; i++)
for(j=0; j<3; j++)
cin>>score[i][j];

for (int k = 0; k < 5; ++k) {
average[k] = (score[k][0] + score[k][1] + score[k][2]) * 1.0 / 3;
}

for (int l = 0; l < 5; ++l) {
cout<<setprecision(2);
cout << score[l][0] << " " << score[l][1] << " " << score[l][2] << " " << setiosflags(ios::fixed) << setprecision(2) << average[l] <<" ";
cout <<endl;
}

double sum = 0.0;
for (int m = 0; m < 5; ++m) {
sum += average[m];
}
cout << setiosflags(ios::fixed) << setprecision(2) << sum / 5 <<endl;
return 0;

}``````