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<stdio.h>
int main(void)
{
	int n,e=0,i,a,s,d,f,x[1000],w[1000],q[1000],j,o,k[1000];
	scanf("%d",&n);
	e=n*(n-1)/2;
	for(i=0;i<e;i++){
		x[i]=0;
		w[i]=0;
		q[i]=0;
	}	
	for(i=0;i<e;i++){
		scanf("%d %d %d %d",&a,&s,&d,&f);
		if(d<f){
			x[s]+=3;
		}
		if(f<d){
			x[a]+=3;
		}	
		if(d==f){
			x[a]++;
			x[s]++;
		}
	}
	for(i=1;i<=n;i++){
		w[i]=x[i];
	}	
	o=0;
	for(i=1;i<=n-1;i++){
		for(j=i+1;j<=n;j++){
			if(x[i]<x[j]){
				o=x[j];
				x[j]=x[i];
				x[i]=o;
			}
		}
	}	
	for(i=1;i<=n;i++){
		for(j=1;j<=n;j++){
			if(w[i]==x[j]){
				w[i]=j;
				break;
			}
		}
	}
	for(i=1;i<=n;i++){
		printf("%d\n",w[i]);
	}	
		
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	long long n,teama,teamb,score[1001]={0},c,d,number[1001],kari[1001];
	cin>>n;
	for(int i=0;i<n*(n-1)/2;++i){
		cin>>teama>>teamb;
		cin>>c>>d;
		if(c>d){
			score[teama]+=3;
		}
		else if(c<d){
			score[teamb]+=3;
		}
		else{
			score[teama]+=1;
			score[teamb]+=1;
		}

	}
	int max=-1,memo,count=0;
	for(int j=1;j<=n;++j){
		for(int i=1;i<=n;++i){
			if(max<score[i]){
				max=score[i];
				memo=i;
			}
		}
		number[memo]=j;
		for(int k=1;k<=n;++k){
			if(memo==k){
				continue;
			}
			if(score[memo]==score[k]&&score[memo]!=-1&&score[k]!=-1){
				number[k]=j;
				score[k]=-1;
				count++;
			}
		}
		j+=count;
		count=0;
		score[memo]=-1;
		max=-1;
	}
	
	for(int i=1;i<=n;++i){
		cout<<number[i]<<endl;
	}
	return 0;
}

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

int main(){
int n;
cin >> n;
int m;
m=n*(n-1)/2;
int a[m];
int b[m];
int c[m];
int d[m];
int e;
int f;
int g[n];
int h[n];
e=0;
while(e<m){
cin >> a[e];
cin >> b[e];
cin >> c[e];
cin >> d[e];
e=e+1;}
e=0;
while(e<n){
g[e]=0;
h[e]=1;
e=e+1;}
e=0;
while(e<n){
f=0;
while(f<m){
if(a[f]==e+1){if(c[f]>d[f]){g[e]=g[e]+3;}
              if(c[f]==d[f]){g[e]=g[e]+1;}}
if(b[f]==e+1){if(c[f]<d[f]){g[e]=g[e]+3;}
              if(c[f]==d[f]){g[e]=g[e]+1;}}
f=f+1;}
e=e+1;}
e=0;
while(e<n){
f=0;
while(f<n){
if(g[e]<g[f]){h[e]=h[e]+1;}
f=f+1;}
e=e+1;}
e=0;
while(e<n){
cout << h[e] <<endl;
e=e+1;}
}

C++: #include<iostream>
#include<map>
#include<algorithm>
using namespace std;
typedef pair<int,int> P;
main(){
  pair<int,P> team[101]; //first=number second=point&rank
  int n;
  int right,left,scorer,scorel;
  int count=0;
  cin>>n;
  for(int i=1;i<=n;i++){
    count=count+i-1;
    team[i].first=i;
    team[i].second.first=0;
  } 
  for(int i=0;i<count;i++){
    cin>>right>>left>>scorer>>scorel;
    if(scorer==scorel){
      team[right].second.first=team[right].second.first+1;
      team[left].second.first=team[left].second.first+1;
    }
    else if(scorer>scorel){
      team[right].second.first=team[right].second.first+3;
    }
    else{
      team[left].second.first=team[left].second.first+3;
    }
  }
  for(int i=1;i<=n;i++){
    for(int j=n;j>1;j--){
      if(team[j].second.first>team[j-1].second.first){
	pair<int,P> a;
	a=team[j];
	team[j]=team[j-1];
	team[j-1]=a;
      }
    }
  }
  int now=1;
  for(int i=1;i<=n;i++){
    team[i].second.second=now;
    if(i!=n){
      if(team[i].second.first!=team[i+1].second.first){
	now=now+1;
      }
    }
  }
  sort(team,team+n+1);
  for(int i=1;i<=n;i++){
    cout<<team[i].second.second<<endl;
  }
}

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

typedef long long ll;
typedef pair<int, int> P;
#define MOD 1000000007
#define INF (1 << 30)
#define REP(i, m, n) for(int i = (int)m; i < (int)n; ++i)
#define rep(i, n) REP(i, 0, n)


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n; cin >> n;
    vector<P> point(n);
    rep(i, n) point[i].second = i;
    rep(i, n*(n-1)/2) {
        int a, b, c, d; cin >> a >> b >> c >> d;
        a--, b--;
        if(c > d) point[a].first += 3;
        if(c == d) point[a].first++, point[b].first++;
        if(c < d) point[b].first += 3;
    }
    sort(point.begin(), point.end());
    reverse(point.begin(), point.end());

    vector<int> ans(n);
    rep(i, n) {
        if(i != 0 && point[i].first == point[i-1].first) {
            ans[point[i].second] = ans[point[i-1].second];
        } else {
            ans[point[i].second] = i + 1;
        }
    }
    rep(i, n) cout << ans[i] << '\n';
    return 0;
}

C++: #include <bits/stdc++.h>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const ll MOD=1e9+7;
const ll INF=1e18;

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

int main(){
    int n; cin>>n;
    vector<P> team(n);

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

    sort(team.begin(), team.end(), greater<P>());

    vector<int> ans(n+10);
    for(int i=0; i<n; i++){
        if(i==0){
            ans[team[i].sc]=i+1;
        }
        else{
            if(team[i-1].fs==team[i].fs){
                ans[team[i].sc]=ans[team[i-1].sc];
            }
            else ans[team[i].sc]=i+1;
        }
    }

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