c语言中,定义一个学生结构体类型,包括学号、姓名、性别、年龄、2门课成绩,定义两个子函数,定义
1个回答
2016-06-05
展开全部
printf("please input the second student name:\r\n");
scanf("%s", b.name);
printf("please input the second student sex:\r\n");
scanf("%s", b.sex);
printf("please input the second student age:\r\n");
scanf("%d", &b.age);
printf("please input the second student score:\r\n");
scanf("%d", &b.score);
if(a.score >= b.score)
pStudent = &a;
else
pStudent = &b;
printf("the score higher student info:\r\n");
printf("name = %s, sex = %s, age = %d, score = %d\r\n", pStudent->name, pStudent->sex, pStudent->age, pStudent->score);
return 0;
}
scanf("%s", b.name);
printf("please input the second student sex:\r\n");
scanf("%s", b.sex);
printf("please input the second student age:\r\n");
scanf("%d", &b.age);
printf("please input the second student score:\r\n");
scanf("%d", &b.score);
if(a.score >= b.score)
pStudent = &a;
else
pStudent = &b;
printf("the score higher student info:\r\n");
printf("name = %s, sex = %s, age = %d, score = %d\r\n", pStudent->name, pStudent->sex, pStudent->age, pStudent->score);
return 0;
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询