输入两个学生的学号,成绩,输出成绩较高的学生的学号姓名和成绩
来源:互联网 发布:大数据麦肯锡定义 编辑:程序博客网 时间:2024/04/30 18:49
#include<stdio.h>
int main()
{
struct Student
{
long int num;
char name[20];
float score;
} student1,student2;
scanf("%ld%s%f",&student1.num,student1.name,&student1.score);
scanf("%ld%s%f",&student2.num,student2.name,&student2.score);
printf("The higher score is:\n");
if(student1.score>student2.score)
printf("%ld %s %f\n",student1.num,student1.name,student1.score);
else if(student1.score<student2.score)
printf("%ld %s %f\n",student2.num,student2.name,student2.score);
else
{
printf("%ld %s %f\n",student1.num,student1.name,student1.score);
printf("%ld %s %f\n",student2.num,student2.name,student2.score);
}
return 0;
}
int main()
{
struct Student
{
long int num;
char name[20];
float score;
} student1,student2;
scanf("%ld%s%f",&student1.num,student1.name,&student1.score);
scanf("%ld%s%f",&student2.num,student2.name,&student2.score);
printf("The higher score is:\n");
if(student1.score>student2.score)
printf("%ld %s %f\n",student1.num,student1.name,student1.score);
else if(student1.score<student2.score)
printf("%ld %s %f\n",student2.num,student2.name,student2.score);
else
{
printf("%ld %s %f\n",student1.num,student1.name,student1.score);
printf("%ld %s %f\n",student2.num,student2.name,student2.score);
}
return 0;
}
0 0
- 输入两个学生的学号,成绩,输出成绩较高的学生的学号姓名和成绩
- 输入10个学生的姓名、学号和成绩,将其中不及格者输出
- chapter5课后习题——输入10个学生姓名、学号和成绩,将其中不及格者的姓名、学号和成绩输出
- 7--3(输入与输出学生的学号姓名与成绩)
- 【数据结构上机作业】输入一批学生的成绩(至少包括学生学号、姓名、课程成绩),用单链表存储,输出大于平均成绩的学生信息。
- 输入3个学生的学号、姓名和三门功课成绩,输出平均分最高的同学
- 1.查询全部学生的学号、姓名、课程名称、成绩。
- 查询学生 学号、姓名和平均成绩
- 实验1 输入若干个学生的信息(学号、姓名、成绩),当输入学号为0时结束
- 输入学生的姓名学号成绩,并按平均分由低到高排序
- 编写一个程序,已有若干学生的数据,包括学号,姓名,成绩,要求输出这些学生的数据并计算出学生人数和平均成绩
- 【C语言】建立一个数组存储学生的学号、姓名和三门课程成绩和平均成绩【原创技术】
- 【c语言】有50个学生,要求输出成绩在80分以上的学生的学号和成绩
- PHP之键盘输入四个学生的学号 姓名 语文 数学 英语信息 ,计算出每个学生的平均成绩,输出
- 输入5个学生的姓名和成绩,顺序输出这五个学生的姓名和成绩,并输出最高成绩的姓名和成绩
- 输入n(n<46)个学生的姓名和成绩,顺序输出这n个学生的姓名和成绩,并输出最高成绩的姓名和成绩。
- 扩展练习4(学生类设计).设计一个友元函数,按照成绩从高到低的顺序输出姓名、学号和成绩信息
- 学生成绩, 学号, 姓名。小程序
- android上传图片压缩图片大小
- 强化学习-无模型控制(上)
- 【leetcode】169. Majority Element
- js 对象借用方法和sessionStorage用法。
- 强化学习-无模型控制(下)
- 输入两个学生的学号,成绩,输出成绩较高的学生的学号姓名和成绩
- 安卓开发者赚钱之道
- 在action中必须是protected
- C++第七次上机实验
- 【Linux】搭建本地yum源
- 【DRP】将DRP物理模型导出SQL脚本
- php基础-错误处理
- ubuntu16.04系统开机有1分30秒的等待时间
- Recyclerview点击事件