【简单排序】 水题
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
struct node
{
string name;
string id;
int grade;
};
bool cmp(node a, node b)
{
return a.grade > b.grade;
}
int main(int argc, char const *argv[])
{
int n;
cin >> n;
vector<node> v(n);
for (int i = 0; i < n; i++)
{
cin >> v[i].name >> v[i].id >> v[i].grade;
}
sort(v.begin(), v.end(), cmp);
int grade1, grade2;
cin >> grade1 >> grade2;
int cnt = n;
for (int i = 0; i < n; i++)
{
if (v[i].grade >= grade1 && v[i].grade <= grade2)
{
cout << v[i].name << " " << v[i].id << endl;
cnt--;
}
}
if (cnt == n)
{
cout << "NONE" << endl;
}
return 0;
}