#include #include #include using namespace std; const int L=100000; class Team{ public: char name[L+1]; int goals,pts; bool operator<(const Team&t)const{ if(t.pts==pts) if(t.goals==goals) if(strcmp(name,t.name)>0) return true; else return false; else return goalsb) t[p1].pts+=3; else if(a==b){ t[p1].pts++; t[p2].pts++; } else t[p2].pts+=3; } memset(out,0,sizeof(out)); sort(t+1,t+5); for(int i=4;i>=1;i--) printf("%s\n",t[i].name); /*for(int j=0;;j++){ if(t[i].name[j]==' ') break; printf("%s\n",t[i].name[j]); }*/ return 0; }