#include <iostream>
#include <list>
#include <string>
using namespace std;
typedef unsigned int UINT;
struct student
{
string Name;
UINT Mark_Math;
UINT Mark_Informatics;
student() : Name("NULL"), Mark_Math(0), Mark_Informatics(0){}
student( const char* str, UINT m_m, UINT m_i ) : Name(str), Mark_Math(m_m), Mark_Informatics(m_i){}
};
bool comp_mark_math( student &a, student &b )
{
return a.Mark_Math < b.Mark_Math;
}
int main()
{
list<student> arr;
arr.push_back( student("Ivanov", 5, 4) );
arr.push_back( student("Petrov", 2, 3) );
arr.push_back( student("Sidorov", 3, 3) );
arr.push_back( student("Soloveq", 5, 5) );
arr.push_back( student("Beshen", 4, 3) );
arr.sort( comp_mark_math );
list<student>::const_iterator it = arr.begin();
for (int i = 0; it != arr.end(); it++)
{
cout << "Student #" << ++i << endl;
cout << "Name: " << it->Name << endl
<< "Math: " << it->Mark_Math << endl
<< "Informatics: " << it->Mark_Informatics << endl;
}
return 0;
}