例题9.2
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了例题9.2相关的知识,希望对你有一定的参考价值。
#include<stdio.h> int main() { struct Student { int num; char name[20]; float score; }student1,student2;//定义结构变量 scanf("%d%s%f",&student1.num,student1.name,&student1.score) ; scanf("%d%s%f",&student2.num,student2.name,&student2.score) ; printf("The higher score is :\n"); if(student1.score>student2.score) printf("%d %s %6.2f\n",student1.num,student1.name,student1.score); else if(student1.score<student2.score) printf("%d %s %6.2f\n",student2.num,student2.name,student2.score); else { printf("%d %s %6.2f\n",student1.num,student1.name,student1.score); printf("%d %s %6.2f\n",student2.num,student2.name,student2.score); } return 0; }
10101 WANG 89
10103 LING 90
The higher score is :
10103 LING 90.00
--------------------------------
Process exited after 16.95 seconds with return value 0
请按任意键继续. . .
以上是关于例题9.2的主要内容,如果未能解决你的问题,请参考以下文章
Xcode 9.2升级导致此错误:“命令/ bin / sh失败,退出代码为1”
MAC OSX Xcode 9.2链接器命令失败,退出代码为1(使用-v查看调用)