#include "windows.h"
#include "stdio.h"
#define NAME_LENGTH 32
#define STUDENT_COUNT 3
struct TStudent
{
char szName[NAME_LENGTH];
int nScore1;
int nScore2;
};
void main()
{
printf("输入学生信息:\n");
TStudent arrStudent[STUDENT_COUNT];
for(int i = 0; i < STUDENT_COUNT; i++)
{
scanf("%s %d %d", arrStudent[i].szName, &arrStudent[i].nScore1, &arrStudent[i].nScore2);
}
for(int i = 0; i < STUDENT_COUNT; i++)
{
printf("%s %.1f\n", arrStudent[i].szName, (float)(arrStudent[i].nScore1 + arrStudent[i].nScore2) / 2);
}
system("pause");
return ;
}