

我的解法:
一、信息
(1)输入两个学生的学号、姓名、成绩。
(2)输出成绩高的那个
二、分析
(1)直接用上一个题目的结构体输出输入结论即可
(2)通过上一题的引用if比较即可
三、遇到的问题
(1)if else语句不熟,选择结构前面的章节这方面得重点看看。
四、代码实现
#include<stdio.h>
int main()
{
struct Student
{
int num;
float score;
char name[20];
}student1,student2;
printf("please enter student1:");
scanf("%d %f %s",&student1.num,&student1.score,&student1.name);
printf("please enter student2:");
scanf("%d %f %s",&student2.num,&student2.score,&student2.name);
if(student1.score>student2.score)
{
printf("%d %f %s",student1.num,student1.score,student1.name);
}
else
{
printf("%d %f %s",student2.num,student2.score,student2.name);
}
return 0;
}
运行结果:

五、正确答案:




六、学到了什么——收获
引用的作用
七、对程序分析的解析
易错点画蛇添足&
八、易错点
1.if else语句
九、反思总结
要看看选择结构了if