#include<iostream.h>
#include<string.h>
#include<iomanip.h>
struct student
{
int num;
char name[10];
int eng;
int math;
};
//请在下方给calTotal函数的实现代码
void main()
{
student stu[5]={{101,"Tom",88,30},{102,"Marry",98,100},{103,"John",60,70},{104,"Kitty",78,80},{105,"Betty",90,80}};
int engtotal;//记录英语总分
int mathtotal;//记录数学总分
cout<<"学生成绩统计"<<endl;
for (int i=0;i<5;i++)
{
cout<<setw(5)<<stu[i].num<<setw(10)<<stu[i].name<<setw(5)<<stu[i].eng<<setw(5)<<stu[i].math<<endl;
}
//请在下方调用calTotal函数
cout<<"英语总分"<<<<engtotal<<endl;
cout<<"数学总分"<<<<mathtotal<<endl;
}
用c++引用的方法类似<类型> &<变量名1>=<变量名2>来完成calTotal函数,计算engtotal和mathtotal,