#include <stdio.h>
struct students
{
char number[15];
int z;
int m;
float aver;
};
void input(struct students *p)
{
int i;
for(i=0;i<3;i++)
scanf("%s%d%d",p[i].number,&p[i].z,&p[i].m);
}
fun(struct students *p)
{
int i;
for(i=0;i<3;i++)
{
p[i].aver=(float)(p[i].m+p[i].z)/2;
}
}
void output(struct students *p)
{
int i;
printf("%-15s%-10s%-10s%-10s\n","学号","数学期中","数学期末","平均成绩");
for(i=0;i<3;i++)
printf("%-15s%-10d%-10d%-10f\n",p[i].number,p[i].z,p[i].m,p[i].aver);
}
void main()
{
struct students a[3],*p=a;
input(p);
fun(p);
output(p);
}