/* Note:Your choice is C IDE */
#include "stdio.h"
void main()
{
int i;
struct student{
char num[22];
char name[33];
char sex;
int age;
};
struct student stu[3];
for(i=0;i<2;i++)
{
printf("请输入第%d个学生的信息:\n",i+1);
printf("number:");
scanf("%s",stu[i].num);
printf("name:");
scanf("%s",stu[i].name);
printf("sex:");
scanf("%c",&stu[i].sex);
printf("\nage:");
scanf("%d",&stu[i].age);
}
printf("number name sex age \n");
for(i=0;i<2;i++)
{
printf("%-8s%-8s %-8c %-8d\n",stu[i].num,stu[i].name,
stu[i].sex,stu[i].age);
}
}
Xyino_Snake
望远
相关分类