#include #include #include #include #include #include using namespace std; char t1[105],t2[105],s[105]; char ec[10][105]; int puncte[150],gol[150],lg[150]; int g1,g2,lg1,lg2,poz1,poz2,k,ok,i,j,x,e; int main() { for(int t = 1; t <= 6; ++t) { memset(s, 0 ,sizeof(s)); cin.getline(s,105); memset(t1, 0 ,sizeof(t1)); memset(t2, 0 ,sizeof(t2)); x=strlen(s); g1=0;g2=0;lg1=0;lg2=0;poz1=0;poz2=0;g1=0;g2=0; for( i = 0; s[i]!=' '; ++i) t1[++lg1]=s[i]; for( j = i+1; s[j]!= ' '; ++j) t2[++lg2]=s[j]; for( i = j+1; s[i]!= ' '; ++i) g1=g1*10+(s[i]-'0'); for( j = i+1; jg2) puncte[poz1]+=3; else if (g1==g2){puncte[poz1]+=1;puncte[poz2]+=1;} else puncte[poz2]+=3; gol[poz1]+=g1; gol[poz2]+=g2; ec[poz1][lg1+1]='\0'; ec[poz2][lg2+1]='\0'; } //sortez ok=0; while(ok == 0) { ok=1; for(int i = 1; i < 4; ++i) { if(puncte[i]0) { swap(puncte[i],puncte[i+1]); swap(ec[i],ec[i+1]); swap(lg[i],lg[i+1]); swap(gol[i],gol[i+1]); ok=0; } } } } for(i = 1; i <= 4; ++i) cout<