struct stu
{
long int Num;
char name[20];
char gender[10];
int age;
char addr[100];
};
void print_stu_mes(struct stu* pStu,int i)
{
printf("the %dth student's personal message is:\n",(i+1));
printf("Number is:%ld\nName is:%s\nGender is:%s\nAge is:%d\nAddress is:%s\n",pStu->Num,pStu->name,pStu->gender,pStu->age,pStu->addr);
}
void main()
{
struct stu student[5];
for(int i=0;i<5;i++)
{
printf("Input the %dth student's message\n",(i+1));
scanf("%ld %s %s %d %s",&student[i].Num,student[i].name,student[i].gender,&student[i].age,student[i].addr);
}
for(i=0;i<5;i++)
{
print_stu_mes(&student[i],i);
}
}
taj
957