浙江大学PAT_甲级_1083. List Grades (25)

Opencv4.5.1 微信二维码识别功能 QRCode 编译与使用 C++ 部分参考:https://mp.weixin.qq.com/s/2GZAJAUPHTXFOKDRv-D21Q 一、下载源码 https://github.com/opencv 二、源码编译 ① 在cmake中添加源码编译路径和生成路径,第一次点击configure。 ② 添加contrib路径 第一次configure后,找到OPENCV_EXTRA_MODULES_PATH,将contrib路径添加进来,注意要具体到modules/,继续configure。 .. 阅读详情

题目链接:点击打开链接

Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grades are in a given interval.

Input Specification:

Each input file contains one test case. Each case is given in the following format:

N
name[1] ID[1] grade[1]
name[2] ID[2] grade[2]
... ...
name[N] ID[N] grade[N]
grade1 grade2

where name[i] and ID[i] are strings of no more than 10 characters with no space, grade[i] is an integer in [0, 100], grade1 and grade2 are the boundaries of the grade's interval. It is guaranteed that all the grades are distinct.

Output Specification:

For each test case you should output the student records of which the grades are in the given interval [grade1, grade2] and are in non-increasing order. Each student record occupies a line with the student's name and ID, separated by one space. If there is no student's grade in that interval, output "NONE" instead.

Sample Input 1:
4
Tom CS000001 59
Joe Math990112 89
Mike CS991301 100
Mary EE990830 95
60 100
Sample Output 1:
Mike CS991301
Mary EE990830
Joe Math990112
Sample Input 2:
2
Jean AA980920 60
Ann CS01 80
90 95
Sample Output 2:
NONE
我的C++代码:

#include<iostream>
#include<algorithm>
#include<string>
#include<array>
using namespace std;
int main()
{
	int i = 0, n = 0;//n学生人数
	int grade=0,mingrade = 0, maxgrade = 0;//mingrade最低分数线,maxgrade最高分数
	string name, ID;
	array<string,101> NameAndID;//数组以分数为下标用来存储姓名和ID
	NameAndID.fill("#");//姓名和ID全部设置为"#"
	cin >> n;
	for (i = 0; i < n; i++)
	{
		cin >>name >> ID >> grade;
		NameAndID[grade] = name + ' ' + ID;
	}
	cin >> mingrade >> maxgrade;
	for (i =maxgrade; i >=mingrade; i--)//从最高分到最低分输出姓名和ID
	{
		if (NameAndID[i] != "#")
		{
			cout << NameAndID[i] << endl;
			n = -1;
		}
	}
	if (n!=-1)//没有符合条件的人
	{
		cout << "NONE";
	}
	//system("pause");
	return 0;
}


博途WinCC多语言项目配置指南 在博途(TIA Portal)中为WinCC项目配置多语言功能,需通过系统化步骤实现界面文本的动态切换。 阅读详情

相关推荐

定时移动鼠标点击鼠标,防止电脑息屏的vba脚本

定时移动鼠标,使系统始终处于激活状态,防止系统息屏。

panfei263031的博客 5935

C++解PTAA1083 List Gr

如果每道题目都像这道题目那么简单就好了,越写越有感觉,这道题唯一难点在于输出None,那N就在cnt里数,如果没有数到那就输出0;

执念斩长河 833

保姆级教程:在Ubuntu 22.04上搞定PX4 V1.14 + ROS2 Humble的HITL仿真(避坑实录)

本文提供在Ubuntu 22.04上配置PX4 V1.14与ROS2 Humble的HITL仿真环境的详细教程,涵盖环境准备、固件编译、QGroundControl配置、ROS2通信设置及联调测试。特别针对版本兼容性、Gazebo插件构建和MicroDDS配置等常见问题提供避坑指南,帮助开发者高效搭建无人机仿真系统。

weixin_30836759的博客 1009

Pat(Advanced Level)Practice--1083(List Grades)

Pat1083代码 题目描述:

奋起的Coder。。。 810

Python实战:5分钟搞定N-CMAPSS航空发动机数据集解析(附完整代码)

本文提供了一份针对N-CMAPSS航空发动机数据集的快速解析实战指南。通过Python的h5py库,详细演示了如何读取HDF5文件结构、理解数据分类(如传感器、健康参数、场景描述符)并加载为Pandas DataFrame。文章还澄清了数据集中常见的变量数量疑惑,并给出了从数据加载到构建剩余使用寿命预测模型预处理流水线的完整代码,帮助工程师和研究人员高效入门航空发动机预测性维护分析。

weixin_29057065的博客 422

STM32G474使用HRTIM触发多路ADC采样,通过DMA传输,通过串口打印显示,实现PWM中间时刻采样,避免开关噪声

本章工程使用HRTIM定时器进行ADC的触发,打开主定时器,子定时器A,B,C。(本工程未使用到A与C定时器,配置时可无需打开)主定时器配置:设置主定时器的频率为100KHz,并且设置自动更新以及自动重装载值。子定时器B设置:设置子定时器B为100KHz,并且每九次计数完成后产生一次中断。配置如上:1.打开自动预装载值2.打开自动复位3.设置死区时间以及互补PWM4.定时器复位触发更新寄存器5.定时器翻转重置更新6.重置触发源(定时器计数器在发生更新事件时重置)

weixin_41407439的博客 4916

1083 List Grades(25 分)(C++)

Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grades ...

qq_41562704的博客 260

分布式计算Ray框架面试题及参考答案

动态任务图执行引擎是一种能够根据任务之间的依赖关系和运行时的实际情况,动态构建和执行任务图的系统。在 Ray 中,动态任务图执行引擎允许任务在运行时根据数据可用性、计算资源状态等因素,灵活地决定后续任务的执行顺序和方式。对于 AI 应用来说,其往往具有动态性的特点。例如,在深度学习模型的训练过程中,可能需要根据训练的结果动态调整下一轮训练的参数、数据增强方式或者模型结构。动态任务图执行引擎可以很好地支持这些动态需求。它能够根据 AI 应用中各个任务的实时输出和依赖关系,动态地生成和调整任务图。

大模型大数据攻城狮的专栏 1354

1083 List Grades (25)

Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grades ...

ysq96的博客 238

句向量(句嵌入)模型sent2vec的训练及应用

本文讨论NLP中的句向量模型(sent2vec),也就是将一个完整的句子映射成一个实数向量的技术。这方面已经发表的成果也是比较多的,本文中所涉及的技术主要源自NAACL 2018的一篇论文,其中提出的sent2vec模型可以理解为词嵌入技术中经典的CBOW方法的扩展,该所谓的扩展中一个重要改进就是引入了n-gram

白马负金羁 1万+

我写了一个自动识别火车车厢位置的算法【lidar点云识别】

我写了一个自动识别火车车厢位置的算法【lidar点云识别】

qq_43212290的博客 805

1083. List Grades (25)

Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grades a

accbbbxx的博客 394

华为OD机考双机位C卷 - 池化资源共享 (Java & Python& JS & C/C++ & GO )

华为OD机考双机位C卷 - 池化资源共享 (OD上机考试双机位C卷)。提供Java、C++、Python、Go、JavaScript源码实现,并提供完整思路讲解,以及在线OJ模拟做题。

算法大师! 1073

PAT甲级 1083 List Grades

浙江大学PAT题目解答内容. Contribute to ZouJiu1/PAT development by creating an account on GitHub.GitHub - ZouJiu1/PAT: 浙江大学PAT题目解答内容。

邹九的个人博客 127

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

【PAT甲级A1083】List Grades (25分)(c++)

1083 List Grades (25分) 作者:CHEN, Yue 单位:浙江大学 代码长度限制:16 KB 时间限制:400 ms 内存限制:64 MB Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student rec

小庄同学的博客 154

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

PAT (Advanced Level) Practice A1083 List Grades (25 分)(C++)(甲级)

1083 List Grades (25 分)题目AC代码 题目 Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those stu...

izhxxx的博客 212

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

【PAT】A1083. List Grades (25)

Author: CHEN, Yue Organization: 浙江大学 Time Limit: 400 ms Memory Limit: 64 MB Code Size Limit: 16 KB A1083. List Grades (25) Given a list of N student records with name, ID and grade. You are supp...

Duke 275

别再只会%d输出了!C/C++中二进制、八进制、十六进制的5种实战格式化技巧

本文详细介绍了C/C++中二进制、八进制、十六进制的5种实战格式化技巧,包括printf的#标志自动添加前缀、bitset库的二进制输出、进制作用域控制、自定义进制转换函数模板以及网络协议分析器的实战案例。这些技巧能帮助开发者在嵌入式开发、网络协议分析等场景中更高效地处理数据输出。

weixin_30298497的博客 277

PAT A1083 list grades (25)

#include #include using namespace std; struct stut{ char name[12]; char id[12]; int scr; }stu[105]; int cmp(stut a,stut b){ return a.scr>b.scr; } int main(){ int n,i,num=0,grade1,grade2;

momottyy的专栏 291

1083 List Grades (25分)

Given a list ofNstudent records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grades ...

haohao0626的博客 212

PAT 1083 List Grades(25 分)(排序)

Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grades ...

weixin_42671353的博客 251

PAT甲级真题 1083 List Grades (25分) C++实现(简单数组排序)

题目 Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grad...

zhang35的博客 229

A1083 List Grades (25 分)

Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the gr...

weixin_30649641的博客 190

【算法每日一练】PAT 甲级1083 java

1083 List Grades (25分) Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student recor...

梓莘 219

1083 List Grades (25分)【结构体排序】

1083List Grades(25分) Given a list ofNstudent records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student reco...

胡小涛的博客 206

PAT 1083. List Grades (25)

1083. List Grades (25) Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those stude...

dengkonglou4529的博客 147
上一篇: 浙江大学PAT_甲级_1052. Linked List Sorting (25)
下一篇: 浙江大学PAT_甲级_1070. Mooncake (25)
pythontojava
博客等级 码龄12年 84粉丝 140原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值