#include
#include
int main()
{
struct student
{
int number;
char name[20];
char sex;
int age;
char addr[30];
};
struct student s[3]={ {1000,"zhang",'m',21,"shang hai"},
{1001,"li",'f',20,"Bei jing"}
};
s[2].number=1002;
s[2].sex='m';
s[2].age=22;
strcpy(s[2].name,"Liu");
strcpy(s[2].addr,"Guang dong");
printf("%d,%s,%c,%d,%s\n",s[0].number,s[0].name,s[0].sex,s[0].age,s[0].addr);
printf("%d,%s,%c,%d,%s\n",s[1].number,s[1].name,s[1].sex,s[1].age,s[1].addr);
printf("%d,%s,%c,%d,%s\n",s[2].number,s[2].name,s[2].sex,s[2].age,s[2].addr);
return 0;
}
阅读(613) | 评论(0) | 转发(0) |