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

边栏推荐
- 存储引擎分析
- Precautions for postoperative fundus hemorrhage / / must see every day
- How does webapi relate to the database of MS SQL?
- Varnish foundation overview 7
- js逆向请求参数加密:
- js返回内容被unicode编码
- Varnish foundation overview 3
- Reading is the cheapest noble
- Pytorch模型训练到哪里找预训练模型?
- Questions about database: database attachment
猜你喜欢

MES管理系统功能模块之质量管理
![[mrctf2020]ezpop-1 | PHP serialization](/img/65/9b7a3ae3552d8784b0c77a1130d762.png)
[mrctf2020]ezpop-1 | PHP serialization

第八届“互联网+”大赛 | 云原生赛道邀你来挑战
![[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

Machinery -- nx2007 (UG) finite element analysis tutorial 1 -- simple object

Design and implementation of spark offline development framework

Kwai reached out to the "supply side" to find the "source" of live broadcast e-commerce?

首届技术播客月开播在即

Machine learning notes: time series decomposition STL

js内容混淆,返回内容加密
随机推荐
The Web3 era is coming? Inventory of five Web3 representative projects | footprint analytics
Reading is the cheapest noble
Varnish foundation overview 4
Varnish 基础概览5
城市规划馆在设计制作上需要注意什么
画画水族馆的应用特色及功能
The first technology podcast month will be launched soon
Interview summary
Varnish 基础概览2
[Thesis Writing] English thesis writing guide
Error reporting in Luban H5 installation
ctfshow 大赛原题 680-695
[recommendation system] concise principle and code implementation of user based collaborative filtering
Rubymine development tool, refactoring and intention operation
模块导入reload方法
Database application
c语言选择,循环概述
C语言 继续(3n+1)猜想
81. search rotation sort array II
Chiffrement des cookies 8