#include <iomanip>
#include <cmath>
#include <string>
using namespace std;
class student{
private:
string a[5];
string studentname[5];
double studentshuzu[5][4];
double everysums[5];
public:
student(){
for(int i=0;i<5;i++){
cout<<"第"<<i+1<<"位学生的姓名:";
cin>>studentname[i];
for(int j=0;j<4;j++){
cout<<"第"<<i+1<<"行"<<","<<"第"<<j+1<<"科目成绩:"<<endl;
cin>>studentshuzu[i][j];}}}
void everychengji(){
double everysum[5]={0,0,0,0,0};
for(int i=0;i<5;i++){
cout<<"第"<<i+1<<"位学生的总成绩:"<<endl;
for(int j=0;j<4;j++){
everysum[i]=everysum[i]+studentshuzu[i][j];}
cout<<everysum[i]<<endl;}
for(int a=0;a<5;a++){
everysums[a]=everysum[a];}
}
void everyaverage(){
double average[5];
for(int i=0;i<5;i++){
cout<<"第"<<i+1<<"位学生的平均成绩:"<<endl;
average[i]=everysums[i]/4;
cout<<average[i]<<endl;}
}
double zongsum(){
double sum=0;
cout<<"总成绩为:"<<endl;
for(int i=0;i<5;i++){
sum=sum+everysums[i];}
return sum;}
};
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
using namespace std;
int main(){
student s;
s.everychengji();
s.everyaverage();
cout<<s.zongsum();
return 0;}