#include<iostream>
using namespace std;
struct student
{
double id;
float qz;
float qm;
};
void main()
{
student st1,st2,st3,*p1,*p2,*p3;
p1=&st1;p2=&st2;p3=&st3;
cout<<"请输入第一个学生的学号、期中成绩、期末成绩"<<endl;
cin>>p1->id>>p1->qz>>p1->qm;
cin>>p2->id>>p2->qz>>p2->qm;
cin>>p3->id>>p3->qz>>p3->qm;
cout<<"数学期中成绩平均分为:"<<((p1->qz+p2->qz+p3->qz)/3)<<endl;
cout<<"数学期末成绩平均分为:"<<((p1->qm+p2->qm+p3->qm)/3)<<endl;
}
using namespace std;
struct student
{
double id;
float qz;
float qm;
};
void main()
{
student st1,st2,st3,*p1,*p2,*p3;
p1=&st1;p2=&st2;p3=&st3;
cout<<"请输入第一个学生的学号、期中成绩、期末成绩"<<endl;
cin>>p1->id>>p1->qz>>p1->qm;
cin>>p2->id>>p2->qz>>p2->qm;
cin>>p3->id>>p3->qz>>p3->qm;
cout<<"数学期中成绩平均分为:"<<((p1->qz+p2->qz+p3->qz)/3)<<endl;
cout<<"数学期末成绩平均分为:"<<((p1->qm+p2->qm+p3->qm)/3)<<endl;
}