typedef struct
{
char name[30];
long num;
char sex[5];
int age;
float score;
} student;
void main()
{
student stu;
printf("請輸入學生的信息如下:\n");
printf("學生姓名:");
gets(stu.name);
printf("學生學號:");
scanf("%ld",&stu.num);
getchar();
printf("學生性別(男-M; 女-F):");
gets(stu.sex);
printf("學生成績:");
scanf("%f",&stu.score);
printf("您輸入的學生信息如下:\n");
printf("學生姓名:%s\n",stu.name);
printf("學生學號:%ld\n",stu.num);
printf("學生性別:%s\n",stu.sex);
printf("學生成績:%.2f\n",stu.score);
}