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

边栏推荐
- Varnish foundation overview 1
- [Thesis Writing] English thesis writing guide
- Varnish 基础概览2
- js逆向请求参数加密:
- Cookie encryption 15 login encryption
- Quality management of functional modules of MES management system
- Understand the module function of MES management system
- Embedded exit (review and release)
- “乘风破浪”的芒果超媒,能上岸吗?
- 首届·技术播客月开播在即
猜你喜欢

Pytroch Learning Notes 6: NN network layer convolution layer

Machinery -- nx2007 (UG) finite element analysis tutorial 2 -- assembly

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

Ansible ad-hoc 临时命令

cookie加密11

Chiffrement des cookies 8

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

C语言 害死人不偿命的(3n+1)猜想

JS prototype and prototype chain (Lantern Festival meal)

Cookie加密15 登录加密
随机推荐
R language linear regression model fitting diagnosis outliers analysis of domestic gas consumption and calorie examples with self-test questions
Mechanical --nx2007 (UG) -- gap analysis (interference inspection)
JS returned content is encoded by Unicode
js内容混淆,返回内容加密
Ansible ad-hoc temporary command
C语言 说反话
C language final without failing (Part 1)
Stimulus reports reporting tool, stimulus creates and builds reports
Design and implementation of spark offline development framework
MySQL monitoring 5
The Web3 era is coming? Inventory of five Web3 representative projects | footprint analytics
Cub school learning: manual query and ADC in-depth use
Mysql 监控2
81. search rotation sort array II
cookie加密8
Rubymine development tool, refactoring and intention operation
Error reporting in Luban H5 installation
Varnish 基础概览10
Spark 离线开发框架设计与实现
OpenCV和Image之间的转换(亲测有效)