#include #include #include #include #include using namespace std; struct Echipa { char id[150]; long p,goals; void init(){ memset(id,0,sizeof(id)); p=goals=0; } }; long i,cnt,g1,g2,id1,id2; Echipa E[5]; char e1[150],e2[150]; long getId1(){ for(long i=1;i<=cnt;i++){ if(E[i].id == e1) return i; } cnt++; for(long i=0;i<150;i++) E[cnt].id[i] = e1[i]; return cnt; } long getId2(){ for(long i=1;i<=cnt;i++){ if(E[i].id == e2) return i; } cnt++; for(long i=0;i<150;i++) E[cnt].id[i] = e2[i]; return cnt; } bool cmp(const Echipa& a,const Echipa& b){ if(a.p == b.p) { if(a.goals!=b.goals) return a.goals < b.goals; return a.id[1]