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

边栏推荐
- Unity2D--给动画添加关键帧并绑定事件
- Stimulus reports reporting tool, stimulus creates and builds reports
- I, 33 years old, ByteDance test development, unveiled the real income of Beijing "test post"
- GeoTools WKT坐标系转换
- [MRCTF2020]Ezpop-1|php序列化
- Kubernetes core object overview details
- [535. encryption and decryption of tinyurl]
- Varnish 基础概览5
- 关于c语言main函数中int argc,char **argv的理解
- GeoTools:WKT、GeoJson、Feature、FeatureCollection相互转换常用工具
猜你喜欢
![[Thesis Writing] English thesis writing guide](/img/59/88d34814a88a2da19ed6a236825649.png)
[Thesis Writing] English thesis writing guide

Questions about database: database attachment

How to seamlessly transition from traditional microservice framework to service grid ASM

Some thoughts on small program subcontracting and verification of uiniapp subcontracting optimization logic

Sentinel source code analysis Part 7 - sentinel adapter module - Summary

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

Embedded test template

What should be paid attention to in the design and production of the Urban Planning Museum

81. search rotation sort array II

首届技术播客月开播在即
随机推荐
Application of pointer in STC89C52 single chip microcomputer and demonstration of practical cases
【PyTorch实战】生成对抗网络GAN:生成动漫人物头像
Cub school learning: manual query and ADC in-depth use
JS anti shake and throttling
Error reporting in Luban H5 installation
Varnish foundation overview 3
Sklearn notes: make_ Blobs generate clustering data
JS recursive summation 1-100
JS prototype and prototype chain (Lantern Festival meal)
Ansible ad-hoc 临时命令
Pytorch中transforms的用法整理
Cookie encryption 9
C语言 数素数
I, 33 years old, ByteDance test development, unveiled the real income of Beijing "test post"
3-6sql injection website instance step 5: break through the background to obtain web administrator permissions
The first technology podcast month will be launched soon
【推荐系统】基于用户的协同过滤简明原理与代码实现
c语言期末不挂科(上)
[535. encryption and decryption of tinyurl]
Varnish 基础概览7