当前位置:网站首页>C language score ranking
C language score ranking
2022-06-30 01:31:00 【Martin の Blog】

Algorithm design ideas
- Define a structure , These include :name、id as well as score
- Yes score Sort , Find the maximum and minimum values
- Print according to maximum and minimum values name and id
Code
#include <stdio.h>
struct student{
char name[100];
char id[100];
int score;
};
int main(){
struct student st[100], max, min;
max.score = -1;
min.score = 100;
int n, i;
scanf("%d", &n);
for(i=0; i<n; i++){
scanf("%s %s %d", st[i].name, st[i].id, &st[i].score);
}
for(i=0; i<n; i++){
if(st[i].score > max.score){
max = st[i];
}
if(st[i].score < min.score){
min = st[i];
}
}
printf("%s %s\n%s %s\n", max.name, max.id, min.name, min.id);
return 0;
}

边栏推荐
猜你喜欢

Design and implementation of spark offline development framework

MES管理系统功能模块之质量管理

Ansible ad-hoc 临时命令

I, 33 years old, ByteDance test development, unveiled the real income of Beijing "test post"

Statsmodels notes STL
![【图神经网络】图分类学习研究综述[3]:图分类方法评价及未来研究方向](/img/b1/2afa73a14b2f41b7a65c4c2d261e6a.png)
【图神经网络】图分类学习研究综述[3]:图分类方法评价及未来研究方向

Spark 离线开发框架设计与实现

Cookie加密15 登录加密

Cookie加密13

3-6sql injection website instance step 5: break through the background to obtain web administrator permissions
随机推荐
C语言 换个格式输出整数
Understanding of int argc, char * * argv in C language main function
Questions about database: database attachment
Mysql 监控
[535. encryption and decryption of tinyurl]
Sentinel source code analysis Chapter 9 - core process - lookprocesschain finding resource processing chain
[MRCTF2020]Ezpop-1|php序列化
The unity editor randomly generates objects. After changing the scene, the problem of object loss is solved
I, 33 years old, ByteDance test development, unveiled the real income of Beijing "test post"
“乘风破浪”的芒果超媒,能上岸吗?
Mechanical --nx2007 (UG) -- gap analysis (interference inspection)
Varnish foundation overview 6
How to seamlessly transition from traditional microservice framework to service grid ASM
第八届“互联网+”大赛 | 云原生赛道邀你来挑战
The first technology podcast month will be launched soon
【图神经网络】图分类学习研究综述[3]:图分类方法评价及未来研究方向
MySQL monitoring 5
【机器学习Q&A】准确率、精确率、召回率、ROC和AUC
What should be paid attention to in the design and production of the Urban Planning Museum
JS prototype and prototype chain (Lantern Festival meal)