func_code_string: #include <bits/stdc++.h>   using namespace std;   struct team {     string nam;     int pt, diff, get;   } T[55];   int n;   void gao(string s, int pt, int diff, int get) {     for (int i = 0; i < n; i++) {       if (s == T[i].nam) {         T[i].pt += pt;         T[i].diff += diff;         T[i].get += get;         break;       }     }   }   bool cmp(team a, team b) {     if (a.pt != b.pt) return a.pt > b.pt;     if (a.diff != b.diff) return a.diff > b.diff;     return a.get > b.get;   }   void tostring(string &a, string &b, char *s) {     int l = strlen(s);     a =   ;     b =   ;     for (int i = 0; i < l; i++) {       if (s[i] ==  - ) {         for (int j = i + 1; j < l; j++) {           b += s[j];         }         return;       }       a += s[i];     }   }   int main() {     while (cin >> n) {       for (int i = 0; i < n; i++)         cin >> T[i].nam, T[i].pt = 0, T[i].diff = 0, T[i].get = 0;       ;       for (int i = 0; i < n * (n - 1) / 2; i++) {         char str[66];         string a, b;         int sa, sb;         scanf( %s %d:%d , str, &sa, &sb);         tostring(a, b, str);         if (sa > sb) {           gao(a, 3, sa - sb, sa);           gao(b, 0, sb - sa, sb);         } else if (sa == sb) {           gao(a, 1, sa - sb, sa);           gao(b, 1, sb - sa, sb);         } else {           gao(a, 0, sa - sb, sa);           gao(b, 3, sb - sa, sb);         }       }       sort(T, T + n, cmp);       vector<string> res;       res.clear();       for (int i = 0; i < n / 2; i++) {         res.push_back(T[i].nam);       }       sort(res.begin(), res.end());       for (int i = 0; i < res.size(); i++) {         cout << res[i] << endl;       }     }     return 0;   }   