当前位置:网站首页>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;
}

边栏推荐
- Mysql 监控5
- How to seamlessly transition from traditional microservice framework to service grid ASM
- [binary tree] maximum binary tree II
- The first technology podcast month will be launched soon
- [machine learning Q & A] accuracy, accuracy, recall, ROC and AUC
- Interview summary
- JS recursive summation 1-100
- Machinery -- nx2007 (UG) finite element analysis tutorial 2 -- assembly
- 存储引擎分析
- Stringredistemplate disconnects and the value disappears
猜你喜欢

The 8th "Internet +" competition - cloud native track invites you to challenge

【PyTorch实战】生成对抗网络GAN:生成动漫人物头像

首届·技术播客月开播在即

Sklearn notes: make_ Blobs generate clustering data

Embedded test template

Design and implementation of spark offline development framework
![[recommendation system] concise principle and code implementation of user based collaborative filtering](/img/3b/d46e37e7ae245cf2931d32d1ebbe4c.png)
[recommendation system] concise principle and code implementation of user based collaborative filtering

JS returned content is encoded by Unicode

cookie加密9

js内容混淆,返回内容加密
随机推荐
Varnish 基础概览4
Mechanical --nx2007 (UG) -- gap analysis (interference inspection)
[machine learning Q & A] data sampling and model verification methods, hyperparametric optimization, over fitting and under fitting problems
[MRCTF2020]Ezpop-1|php序列化
【图神经网络】图分类学习研究综述[3]:图分类方法评价及未来研究方向
Reading is the cheapest noble
【图神经网络】图分类学习研究综述[2]:基于图神经网络的图分类
Mysql 监控2
首届技术播客月开播在即
Application features and functions of painting Aquarium
Cookie encryption 12
Statsmodels notes STL
一文读懂,MES管理系统模块功能
Pytorch 修改hook源码 获取Per-Layer输出参数(带layer name)
Sentinel source code analysis Part 7 - sentinel adapter module - Summary
Cookie encryption 11
Interview summary
Cookie加密10
OpenCV和Image之间的转换(亲测有效)
GeoTools WKT坐标系转换