~cpp
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
struct student
{
string name;
int score;
};
bool compare(student stu1, student stu2)
{
return stu1.score > stu2.score;
}
void main()
{
ifstream fin("input.txt");
vector <student> vec;
vector <student> ::iterator i=0;
student temp;
while(!fin.eof())
{
fin >> temp.name >> temp.score;
vec.push_back(temp);
}
sort(vec.begin(), vec.end(), *compare);
for(i=vec.begin();i<vec.end();i++)
{
cout << (*i).name << endl;
cout << (*i).score << endl;
}
}