PAT 1083 List Grades[简单]】的更多相关文章

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 are in a given interval. I…
#include <cstdio> #include <cstdlib> using namespace std; class Stu { public: ]; ]; }; int main() { ; // because all the grades are distinct & grade in range of [0, 100] // use simplified bucket sort here Stu* stu[] = {}; int grade; scanf(…
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 are in a given interval. I…
简单排序. #include<cstdio> #include<cstring> #include<cmath> #include<vector> #include<map> #include<stack> #include<queue> #include<string> #include<iostream> #include<algorithm> using namespace std…
https://pintia.cn/problem-sets/994805342720868352/problems/994805383929905152 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…
题意: 输入一个正整数N(<=101),接着输入N个学生的姓名,id和成绩.接着输入两个正整数X,Y(0<=X,Y<=100),逆序输出成绩在x,y之间的学生的姓名和id. trick: 测试点3格式错误因为输出的所有学生姓名和id后面都要换行,大概如果PAT没说不要输出多余的换行的话,就全都加个换行,说了就不加.....…
给定区间[L,R],给出在这区间之内的学生,并且按照他们的成绩非升序的顺序输出. #include <iostream> #include <cstdio> #include <string.h> #include <algorithm> using namespace std; ; struct Stu{ ]; ]; int grade; bool operator<(const Stu tmp)const{ return grade>tmp.…
the problem is from PAT,which website is http://pat.zju.edu.cn/contests/pat-a-practise/1083 and the source code is as followed. /* firstly: sort the array using the algorithm "sort" secondly: traverse all the possible answer and find the most su…
1089 狼人杀-简单版(20 分) 以下文字摘自<灵机一动·好玩的数学>:"狼人杀"游戏分为狼人.好人两大阵营.在一局"狼人杀"游戏中,1 号玩家说:"2 号是狼人",2 号玩家说:"3 号是好人",3 号玩家说:"4 号是狼人",4 号玩家说:"5 号是好人",5 号玩家说:"4 号是好人".已知这 5 名玩家中有 2 人扮演狼人角色,有 2 人说的不…
1001 A+B Format (20)(20 分) Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input Each input file contains one test case. Each case…