#include<stdio.h>
void main()
{
struct student
{
char name[20];
int age;
char sex;
float score;
}stu1;
printf("Input name,age,sex,score:\n");
scanf("%s %d %c %f",stu1.name,&stu1.age,&stu1.sex,&stu1.score);
printf("Output:\n");
printf("name=%s,age=%d\n",stu1.name,stu1.age);
printf("sex=%c,score=%f\n",stu1.sex,stu1.score);
}
运行结果: