Go: package main

import (
	"fmt"
	"bufio"
	"os"
	"strconv"
	"strings"
	"sort"
)

var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextLineInt() []int {
	arr := strings.Split(nextLine(), " ")
	var ret []int
	for _, v := range arr {
		x, _ := strconv.Atoi(v)
		ret = append(ret, x)
	}
	return ret
}

type Pair struct {
	First int
	Second int
}

type Pairs []Pair

func (s Pairs) Len() int {
	return len(s)
}

func (s Pairs) Swap(i, j int) {
	s[i], s[j] = s[j], s[i]
}

func (s Pairs) Less(i, j int) bool {
	return s[i].First > s[j].First
}

func main() {
	var n int
	arr := nextLineInt()
	n = arr[0]
	result := []Pair{}
	for i := 0; i < n; i++ {
		result = append(result, Pair{0, i})
	}
	for i := 0; i < n * (n - 1) / 2; i++ {
		arr := nextLineInt()
		A := arr[0]
		B := arr[1]
		C := arr[2]
		D := arr[3]
		if C > D {
			result[A-1].First += 3
		} else if C < D {
			result[B-1].First += 3
		} else {
			result[A-1].First++
			result[B-1].First++
		}
	}
	sort.Sort(Pairs(result))
	var ans [111]int
	point := 1000000000
	top := 0
	for i, r := range result {
		// 前の人よりポイントが低い
		if point > r.First {
			top = i + 1
			point = r.First
		}
		ans[r.Second] = top
	}
	for i := 0; i < n; i++ {
		fmt.Println(ans[i])
	}
}

C++: #include <map>
#include <cstdio>
#include <queue>
#define REP(i,n) for(int i=0; i<(int)(n); i++)

#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)

inline int getInt(){ int s; scanf("%d", &s); return s; }

using namespace std;

int main(){
  int n = getInt();
  vector<int> p(n);
  map<int, int> ans;
  vector<int> res(n);

  REP(i,n * (n - 1) / 2){
    int a = getInt();
    int b = getInt();
    int c = getInt();
    int d = getInt();

    p[a - 1] += c > d ? 3 : c == d ? 1 : 0;
    p[b - 1] += d > c ? 3 : c == d ? 1 : 0;
  }

  REP(i,n) ans[-p[i]]++;

  int cnt = 1;
  FOR(it, ans){
    REP(i,n) if(-p[i] == it->first)
      res[i] = cnt;
    cnt += it->second;
  }

  REP(i,n) printf("%d\n", res[i]);

  return 0;
}

C++: #include <iostream>
#include <math.h>
#include <string>
#include <stdio.h>
#include <string.h>
#include <algorithm>

using namespace std;

int main(void)
{
    int n, a[100],rank[100], b[100], c[100],d[100],k[100],win[100],lose[100],p[100],pp[100];
    cin >> n;

    for (int i = 0; i < n * (n - 1) / 2; i++)
    {
        cin >> a[i] >> b[i] >> c[i] >> d[i];
        if (c[i] < d[i])
        {
            win[i] = b[i];
            lose[i] = a[i];
            p[i] = 0;
            pp[i] = 0;
        }
        else if (c[i] > d[i])
        {
            win[i] = a[i];
            lose[i] = b[i];
            p[i] = 0;
            pp[i] = 0;
        }
        else if (c[i] == d[i])
        {
            win[i] = 0;
            lose[i] = 0;
            p[i] = a[i];
            pp[i] = b[i];
        }
    }

    for (int i = 0; i < n * (n - 1) / 2; i++)
    {
        for (int j = 1; j < n + 1; j++)
        {
            if (win[i] == j)
            {
                k[j] += 3;
            }
            if (lose[i] == j)
            {
                k[j] += 0;
            }
            if (p[i] == j || pp[i] == j)
            {
                k[j] += 1;
            }            

        }
    }

    for (int j = 1; j < n + 1; j++)
    {
        rank[j] = 1;
        for (int l = 1; l < n + 1; l++)
        {
            if (k[j] < k[l])
            {
                rank[j] += 1;
            }
        }
    }
    for (int j = 1; j < n + 1; j++)
    {
        cout << rank[j] << endl;
    }
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>
#include<stack>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<string> vstring;
typedef vector<pint> vpint;

struct Edge{int to,from,cost;};

#ifdef DEBUG
#define debug cout
#else
stringstream __ss__;
#define debug __ss__
#endif

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) debug << *i << " "; debug << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

#define rep(i,n) for(int i=0;i<(n);++i)
#define repd(i,n) for(int i=(n)-1;i>=0;--i)
#define repn(i,m,n) for(int i=(m);i<=(n);++i)
#define repnd(i,m,n) for(int i=(n);i>=(m);--i)
#define rep0(i,n) for(i=0;i<(n);++i)
#define repd0(i,n) for(i=(n)-1;i>=0;--i)
#define repn0(i,m,n) for(i=(m);i<=(n);++i)
#define repnd0(i,m,n) for(i=(n);i>=(m);--i)
#define all(n) n.begin(),n.end()
#define sz(n) ((int)(n).size())
#define IL for(;;)
#define MP make_pair
#define PB push_back
#define SS stringstream
#define X second
#define Y first
#define PUTLINE debug<<"LINE:"<<__LINE__<<endl;

const int INF = 2147483647/3;
const double EPS = 1e-10;
const double PI = acos(-1.0);

const int dx[]={1,-1,0,0,1,-1,1,-1,0};
const int dy[]={0,0,1,-1,1,-1,-1,1,0};

int k[110];
int res[110];

int main() {
	int n;
	int a,b,c,d;
	cin>>n;
	rep(i,n*(n-1)/2){
		cin>>a>>b>>c>>d;
		--a,--b;
		if(c>d)k[a]+=3;
		else if(c<d)k[b]+=3;
		else ++k[a],++k[b];
	}
//rep(i,n)cout<<k[i]<<endl;
	vpint v;
	rep(i,n)v.PB(MP(-k[i],i));
	sort(all(v));
	int j=0;
	rep(i,n){
		if(i==0||v[i-1].first!=v[i].first)j=i;
		res[v[i].second]=j+1;
	}
	rep(i,n)cout<<res[i]<<endl;
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main()
{
  int n, s[101], cop[101], rank[10101];

  cin >> n;
  for (int i = 0; i < n * (n - 1) / 2; i++){
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (c == d){
      s[a-1]++; s[b-1]++;
    } else {
      (c>d?s[a-1]:s[b-1]) += 3;
    }
  }

  for (int i = 0; i < n; i++) cop[i] = s[i];
  sort(cop, cop + n);
  reverse(cop, cop + n);
  for (int i = n - 1; i >= 0; i--){
    rank[cop[i]] = i + 1;
  }

  for (int i = 0; i < n; i++){
    cout << rank[s[i]] << endl;
  }
}

C++: #include <iostream>
#include <algorithm>
#include <set>
#define MAX 100
using namespace std;
int main() {
  int n, result[MAX]={}, rank[MAX], count=1, r=1;
  set<int> p;
  
  cin >> n;
  for(int i=0; i<n*(n-1)/2; i++) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if(c > d) result[a]+=3;
    else if(c < d) result[b]+=3;
    else {
      result[a]+=1;
      result[b]+=1;
    }
  }
  
  for(int i=1; i<=n; i++) {
    p.insert(result[i]);
  }
  
  for(set<int>::reverse_iterator it=p.rbegin(); it!=p.rend(); it++) {
    for(int i=1; i<=n; i++) {
      if(*it == result[i]) {
	rank[i] = r;
	count++;
      }
    }
    r=count;
  }
  
  for(int i=1; i<=n; i++) {
    cout << rank[i] << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <functional>
using namespace std;

int main() {
	int n ,team1 ,team2 ,score1 ,score2 ,a[100]={} ,save[100]={} ,r;
	cin>>n;
	for(int i=0;i<(n*(n-1)/2);i++){
		team1=0;
		team2=0;
		score1=0;
		score2=0;
		cin>>team1>>team2>>score1>>score2;
		if(score1>score2){
			a[team1]+=3;
		}
		else if(score1<score2){
			a[team2]+=3;
		}
		else if(score1=score2){
			a[team1]++;
			a[team2]++;
		}
	}
	for(int i=1;i<=n;i++){
		save[i]=a[i];
	}
	sort(a,a+n);{
	for(int i=1;i<=n;i++){
		for(int l=0;l<n;l++){
			if(a[l]==save[i]){
				cout<<n-l<<endl;
						
			}
		}
	}
}
return 0;
}