#include <stdio.h>
#define N 5
struct Stu
{
long num;
char name[20];
float score[3];
}stu[N];
int main()
{
void input(struct Stu stu[]);
void print(struct Stu stu[]);
input(stu);
print(stu);
return 0;
}
void input(struct Stu stu[])
{
int i;
for (i = 0; i < N; i++)
{
printf("input the %d student messege:\n", i+1);
scanf("%ld%s%f%f%f", &stu[i].num, stu[i].name, &stu[i].score[0], &stu[i].score[1], &stu[i].score[2]);
}
printf("over");
}
void print(struct Stu stu[])
{
int i;
for (i = 0; i < N; i++)
{
printf("the %d student messege:\n", i+1);
printf("%ld %-20s %4.2f %4.2f %4.2f", stu[i].num, stu[i].name, stu[i].score[0], stu[i].score[1], stu[i].score[2]);
}
}