Note
Code:
#include<bits/stdc++.h>
using namespace std;
struct people{
string name,id;
int grade;
};
bool cmp(people a,people b){
return a.grade>b.grade;
}
int main(){
#ifndef ONLINE_JUDGE
freopen("data.txt","r",stdin);
#endif
int n,low,high;
vector<int> v;
cin>>n;
people p[n];
for(int i=0;i<n;i++){
cin>>p[i].name>>p[i].id>>p[i].grade;
}
cin>>low>>high;
sort(p,p+n,cmp);
int j=0;
while(p[j].grade>high) j++;
while(p[j].grade>=low&&p[j].grade<=high){
v.push_back(j);
j++;
}
if(v.empty()) printf("NONE\n");
else{
for(int i=0;i<v.size();i++){
cout<<p[v[i]].name<<" "<<p[v[i]].id<<endl;
}
}
return 0;
}