PROGRAMMING:Structure type
Analyze the following code to understand the use of struct types.
```
struct stu{
int num;
char name[20];
char sex;
double score;
};
void p(struct stu t){
printf("%d %s %c %lf\n",t.num,t.name,t.sex,t.score);
}
int main(){
Struct stu S1 = {1001, "xiaomili",'m ', 89.0}, / / structure variable initialization
s2={1002,"XiaodiMa"},
s3;
s3.num=1003; // Structure variable member assignment
strcpy(s3.name,"XiaohaiLiu"); // Structure variable member assignment
scanf("%c%lf",&s3.sex,&s3.score); // Structure variable member input
s2=s1; // Mutual assignment of structural variables
p(s1); p(s2); p(s3);
return 0;
}
```
###Input example:
```in
F 80
```
###Output example:
```out
1001 XiaomiLi M 89.000000
1001 XiaomiLi M 89.000000
1003 XiaohaiLiu F 80.000000
```
answer:If there is no answer, please comment
```
struct stu{
int num;
char name[20];
char sex;
double score;
};
void p(struct stu t){
printf("%d %s %c %lf\n",t.num,t.name,t.sex,t.score);
}
int main(){
Struct stu S1 = {1001, "xiaomili",'m ', 89.0}, / / structure variable initialization
s2={1002,"XiaodiMa"},
s3;
s3.num=1003; // Structure variable member assignment
strcpy(s3.name,"XiaohaiLiu"); // Structure variable member assignment
scanf("%c%lf",&s3.sex,&s3.score); // Structure variable member input
s2=s1; // Mutual assignment of structural variables
p(s1); p(s2); p(s3);
return 0;
}
```
###Input example:
```in
F 80
```
###Output example:
```out
1001 XiaomiLi M 89.000000
1001 XiaomiLi M 89.000000
1003 XiaohaiLiu F 80.000000
```
answer:If there is no answer, please comment