#include #include #include #include using namespace std; map team; char teams[5][200]; int goals[5]; int points[5]; int poz[5]; int comparare(char a[200], char b[200]) { int i, j; int nr1, nr2,max; nr1 = strlen(a); nr2 = strlen(b); if (nr1 > nr2) max = nr1; else max = nr2; for (i = 1; i <= max; i++) { if (a[i] > b[i]) return 1; } if (nr2 > nr1) return 1; return 0; } int main() { int i,j; char team1[200], team2[200]; int score1, score2; int k = 0; for (i = 1; i <= 6; i++) { cin>> team1 >> team2 >> score1 >> score2; map::const_iterator it1 = team.find(team1); if (it1 != team.end()) { goals[it1->second] += score1; if (score1 > score2) points[it1->second] += 3; else if (score1 == score2) points[it1->second] += 1; } else { team.insert(pair(team1, ++k)); strcpy(teams[k], team1); goals[k] += score1; if (score1 > score2) points[k] += 3; else if (score1 == score2) points[k] += 1; } map::const_iterator it2 = team.find(team2); if (it2 != team.end()) { goals[it2->second] += score2; if (score2 > score1) points[it2->second] += 3; else if (score1 == score2) points[it2->second] += 1; } else { team.insert(pair(team2, ++k)); strcpy(teams[k], team2); goals[k] += score2; if (score2 > score1) points[k] += 3; else if (score1 == score2) points[k] += 1; } } for (i = 1; i <= 4; i++) poz[i] = i; for (i = 1; i < 4; i++) { for (j = i + 1; j <= 4; j++) { if (points[i]