#include<stdio.h>
struct student{
char name[10];
int num;
char score[3];
}stu[5];
int main(){
void input(struct student stu[]);
void print(struct student stu[]);
input(stu);
print(stu);
return 0;
}
void input(struct student stu[5])
{ int i,j;
for(i=0;i<5;i++){
printf("第%d个学生信息如下:\n",i+1);
printf("name:");
scanf("%s",&stu[i].name);
for(j=0;j<3;j++){
printf("score %d : ",j+1);
scanf("%d",&stu[i].score[j]);
}
printf("\n");
}
}
void print(struct student stu[5])
{ int i,j;
printf("name score1 score2 score3\n");
for(i=0;i<5;i++){
printf("%s",stu[i].name);
for(j=0;j<3;j++){
printf("%7d",stu[i].score[j]);
}
printf("\n");
}
}