标签:
#include<stdio.h>
#include<algorithm>
using namespace std;
struct Student
{
char name[15];
char ID[15];
int gread;
}STU[66666];
bool cmp(Student a,Student b)
{
return a.gread>b.gread;
}
int main()
{
int n;
scanf("%d",&n);
for(int i=0 ; i<n ; ++i)
{
scanf("%s %s %d",&STU[i].name, &STU[i].ID, &STU[i].gread);
}
sort(STU,STU+n,cmp);
int left,right;
scanf("%d%d",&left,&right);
int cnt=0;
for(int i=0 ; i<n ; ++i)
{
if(STU[i].gread>=left &&STU[i].gread<=right)
{
printf("%s %s\n",STU[i].name,STU[i].ID);
++cnt;
}
}
if(0==cnt)
printf("NONE");
return 0;
}
标签:
原文地址:http://www.cnblogs.com/Evence/p/4308308.html