简单排序题
//
// main.cpp
// PATA1083
//
// Created by Phoenix on 2018/2/19.
// Copyright © 2018年 Phoenix. All rights reserved.
//
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
const int maxn = 110;
struct Student {
char name[15];
char id[15];
int grade;
}stu[maxn];
bool cmp(Student a, Student b) {
return a.grade > b.grade;
}
int main(int argc, const char * argv[]) {
int n;
scanf("%d", &n);
for(int i = 0; i < n; i++) {
scanf("%s %s %d", stu[i].name, stu[i].id, &stu[i].grade);
}
int low, high;
scanf("%d %d", &low, &high);
sort(stu, stu + n, cmp);
bool flag = false;
for(int i = 0; i < n; i++) {
if(stu[i].grade <= high && stu[i].grade >= low) {
flag = true;
printf("%s %s\n", stu[i].name, stu[i].id);
}
}
if(flag == false) printf("NONE\n");
return 0;
}