#include<stdio.h>
#include<string.h>
struct date
{
int year;
int month;
int day;
};
struct stu
{
int num;
char name[20];
char sex;
struct date birth;
float score;
};
int main()
{
struct stu s1 = {10010,"zhangsan",'m',2000,5,4,84.5}, s2, s3;
/*****输入学生信息存放在变量s2中*****/
/********** Begin **********/
scanf("%d %s",&s2.num,&s2.name);
getchar();
scanf("%c %d %d %d %f",&s2.sex,&s2.birth.year,&s2.birth.month,&s2.birth.day,&s2.score);
getchar();
/********** End **********/
/*****交换两个结构体变量s1和s2*****/
/********** Begin **********/
s3=s1;
s1=s2;
s2=s3;
/********** End **********/
/*****输出结构体变量s1和s2的成员*****/
/********** Begin **********/
printf("学号:%d\n姓名:%s\n性别:%c\n",s1.num,s1.name,s1.sex);
printf("出生日期:%d年%d月%d日\n成绩:%.1f\n",s1.birth.year,s1.birth.month,s1.birth.day,s1.score);
printf("学号:%d\n姓名:%s\n性别:%c\n",s2.num,s2.name,s2.sex);
printf("出生日期:%d年%d月%d日\n成绩:%.1f\n",s2.birth.year,s2.birth.month,s2.birth.day,s2.score);
/********** End **********/
return 0;
}