当前位置: 首页> 游戏> 单机 > 下载app的软件并安装_与网站建立的链接不安全怎么办_seo第三方点击软件_windows优化大师最新版本

下载app的软件并安装_与网站建立的链接不安全怎么办_seo第三方点击软件_windows优化大师最新版本

时间:2025/7/11 8:50:46来源:https://blog.csdn.net/2401_88085478/article/details/144270457 浏览次数:0次
下载app的软件并安装_与网站建立的链接不安全怎么办_seo第三方点击软件_windows优化大师最新版本

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

题目大意:给出n个考生的姓名、id,分数,要求按照分数从高到低排序,并且输出给定分数区间的考生姓名和id。如果不存在满足条件的考生就输出NONE。
分析:将考生按照分数从高到低排序,且题目已经告知不存在分数相等的学生。之后进行输出,若不存在则输出NONE。

#include<algorithm>
#include <iostream>
#include  <cstdlib>
#include  <cstring>
#include   <string>
#include   <vector>
#include   <cstdio>
#include    <queue>
#include    <stack>
#include    <ctime>
#include    <cmath>
#include      <map>
#include      <set>
#define INF 0xffffffff
#define db1(x) cout<<#x<<"="<<(x)<<endl
#define db2(x,y) cout<<#x<<"="<<(x)<<", "<<#y<<"="<<(y)<<endl
#define db3(x,y,z) cout<<#x<<"="<<(x)<<", "<<#y<<"="<<(y)<<", "<<#z<<"="<<(z)<<endl
#define db4(x,y,z,r) cout<<#x<<"="<<(x)<<", "<<#y<<"="<<(y)<<", "<<#z<<"="<<(z)<<", "<<#r<<"="<<(r)<<endl
using namespace std;typedef struct student
{char name[15],id[15];int sorce;
}student;bool cmp(student a,student b)
{return a.sorce>b.sorce;
}int main(void)
{#ifdef testfreopen("in.txt","r",stdin);//freopen("in.txt","w",stdout);clock_t start=clock();#endif //testint n,f=0;scanf("%d",&n);student num[n+5];for(int i=0;i<n;++i)scanf("%s%s%d",num[i].name,num[i].id,&num[i].sorce);int l,r;scanf("%d%d",&l,&r);sort(num,num+n,cmp);for(int i=0;i<n;++i)if(num[i].sorce>=l&&num[i].sorce<=r)f=1,printf("%s %s\n",num[i].name,num[i].id);if(!f)printf("NONE\n");#ifdef testclockid_t end=clock();double endtime=(double)(end-start)/CLOCKS_PER_SEC;printf("\n\n\n\n\n");cout<<"Total time:"<<endtime<<"s"<<endl;        //s为单位cout<<"Total time:"<<endtime*1000<<"ms"<<endl;    //ms为单位#endif //testreturn 0;
}

关键字:下载app的软件并安装_与网站建立的链接不安全怎么办_seo第三方点击软件_windows优化大师最新版本

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: