#include #include #include #include #include #include using namespace std; char ech[10][500]; int points[10], gol[10]; void schimba(int i) { char aux[500]; points[i] = points[i] + points[i + 1] - (points[i + 1] = points[i]);gol[i] = gol[i] + gol[i + 1]-(gol[i + 1]=gol[i]); strcpy(aux, ech[i]);strcpy(ech[i], ech[i + 1]);strcpy(ech[i + 1], aux); } int main() {int n = 0;for(int i =1;i<=6;++i){char ech1[500], ech2[500]; int g1,g2;bool e1=0,e2=0; //citesc scanf("%s %s %d %d\n", ech1, ech2, &g1, &g2);for(int j = 1; j <= n; ++j){int aux = strcmp(ech1, ech[j]); if(aux == 0) {e1 = true;if(g1 > g2)points[j] += 3;if(g1 == g2) points[j] += 1;gol[j] += g1; } else {aux = strcmp(ech2, ech[j]);if(aux == 0) { e2 = true;if(g2 > g1)points[j] += 3;if(g2 == g1) points[j] += 1;gol[j] += g2; } } } if(!e1) { ++n; strcpy(ech[n], ech1);if(g1>g2) points[n]+=3;if(g1==g2) points[n]+=1;gol[n]+=g1; } if(!e2) { ++n;strcpy(ech[n],ech2); if(g2>g1) points[n]+=3; if(g1==g2) points[n]+=1; gol[n]+=g2;} } bool e = false;while(!e) {e=true; for(int i=1;i 0) { schimba(i); e = false; }}}}for(int i = 1; i <= n; ++i) cout<