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 <iostream>
#include <algorithm>
#include <vector>
#include <string>

using lint = long long;
using ldouble = long double;

void solve() {
    int n;
    std::cin >> n;

    std::vector<int> sums(n, 0);
    int m = n * (n - 1) / 2;
    while (m--) {
        int i, j, x, y;
        std::cin >> i >> j >> x >> y;
        --i, --j;

        if (x == y) {
            sums[i] += 1;
            sums[j] += 1;
        } else if (x < y) {
            sums[j] += 3;
        } else {
            sums[i] += 3;
        }
    }

    for (int i = 0; i < n; ++i) {
        std::cout << std::count_if(sums.begin(), sums.end(),
                                   [&](int s) { return s > sums[i]; }) +
                         1
                  << "\n";
    }
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	int n; cin >> n;
	vector<int> ka(n, 0);
	for (int i = 0; i < (n*n - n) / 2; i++) {
		int a, b, c, d;
		cin >> a >> b >> c >> d;
		if (c > d) {
			ka[a-1] += 3;
		}
		else if (c == d) {
			ka[a-1]++;
			ka[b-1]++;
		}
		else {
			ka[b-1] += 3;
		}
	}
	for (int i = 0; i < n; i++) {
		int jun = 1;
		for (int j = 0; j < n; j++) {
			if (ka[j] > ka[i]) {
				jun++;
			}
		}
		cout << jun << endl;
	}
}

C++: #include <iostream>

using namespace std;

int main()
{
    int pts[101] = {};
    int n;
    cin >> n;

    int const rn = n * ( n - 1 ) / 2;
    for( int i=0; i<rn; ++i ) {
        int ca, cb, pa, pb;
        cin >> ca >> cb >> pa >> pb;
        if ( pa > pb ) {
            pts[ca-1] += 3;
        } else if ( pb > pa ) {
            pts[cb-1] += 3;
        } else if ( pa == pb ){
            pts[ca-1] += 1;
            pts[cb-1] += 1;
        }
    }

    int rank[101] = {};
    int last = -1, rk=0, tr = 1;
    for( int i=0; i<n; ++i ) {
        int mm = 0, r = -1;
        for( int j=0; j<n; ++j ) {
            if ( pts[j] > mm ) {
                mm = pts[j];
                r = j;
            }
        }
        if ( mm == last ) {
            ++tr;
        } else {
            rk += tr > 0 ? tr : 1;
            tr = 1;
        }
        rank[r] = rk;
        last = mm;
        pts[r] = -1;
    }

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

C++: #include<iostream>
#include<cstdio>

using namespace std;

int main(void)
{
int k,n,a[101],b[101],c[101],d[101],t[101]={0};
int cnt;
cin >> n;
k=n*(n-1)/2;
for(int i=0;i<k;i++)
cin >> a[i] >> b[i] >> c[i] >> d[i];
for(int i=0;i<k;i++){
if(c[i]>d[i])
t[a[i]]+=3;
else if(c[i]<d[i])
t[b[i]]+=3;
else{
t[a[i]]+=1;
t[b[i]]+=1;}}

for(int i=1;i<=n;i++){
cnt=1;
for(int j=1;j<=n;j++){
if(t[i]<t[j])
cnt++;}
cout << cnt << endl;
}
return 0;
}

C++: #include <stdio.h>
#include <stack>
#include <math.h>

using namespace std;

struct Team{
	int id,score,order;
};

int main(){

	int N,limit,a,b,a_score,b_score,rank;

	scanf("%d",&N);
	Team team[N+1];
	int result[N+1];

	for(int i = 1; i <= N; i++){
		team[i].score = 0;
		team[i].id = i;
	}

	limit = N*(N-1)/2;

	for(int i = 0; i < limit; i++){
		scanf("%d %d %d %d",&a,&b,&a_score,&b_score);

		if(a_score > b_score){
			team[a].score += 3;
		}else if(a_score < b_score){
			team[b].score += 3;
		}else{ //a_score == b_score
			team[a].score += 1;
			team[b].score += 1;
		}
	}

	for(int i = 2; i <= N; i++){
		for(int k = N; k >= i; k--){
			if(team[k].score > team[k-1].score)swap(team[k],team[k-1]);
		}
	}

	rank = 1;
	team[1].order = rank;
	for(int i = 2; i <= N; i++){
		if(team[i].score == team[i-1].score)team[i].order = rank;
		else{
			team[i].order = i;
			rank = i;
		}
	}

	for(int i = 1; i <= N; i++){
		result[team[i].id] = team[i].order;
	}

	for(int i = 1; i <= N; i++)printf("%d\n",result[i]);


    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int tmp,n,bell,t1,t2,po1,po2,team[110]={0};
  cin >> n;
  bell=n;
  bell*=n-1;
  bell/=2;
  for(int i=0;i<bell;i++){
    cin >> t1 >> t2 >> po1 >> po2;
    if(po1>po2){
      team[t1]+=3;
    }
    else if(po2>po1){
      team[t2]+=3;
    }
    else{
      team[t1]++;
      team[t2]++;
    }
  }

  //勝ち点計算終了。


  int lank[110][2]={0};
  for(int i=0;i<n;i++){
    lank[i][0]=team[i];
    lank[i][1]=i;
  }

  for(int i=0;i<n-1;i++){
    for(int j=n-1;j>i;j--){
      if(lank[j][0]>lank[j-1][0]){
	tmp=lank[j][0];
	lank[j][0]=lank[j-1][0];
	lank[j-1][0]=tmp;
	tmp=lank[j][1];
	lank[j][1]=lank[j-1][1];
	lank[j-1][1]=tmp;
      }
    }
  }

  //順位付け。
  //  int lank_ans[110];
  int LANK=1,tame=1;
  for(int i=0;i<n;i++){
    tame=1;

    while(1){
      if(lank[i][0]==lank[i+1][0]){
	lank[i][0]=LANK;
	//lank[i+1][0]=LANK;
	i++;
	tame++;
      }
    }
    lank[i][0]=LANK;
    LANK+=tame;
  }

  //元の並びに戻す。
  for(int i=0;i<n-1;i++){
    for(int j=n-1;j>i;j--){
      if(lank[j][1]<lank[j-1][1]){
	/*	tmp=lank_ans[j];
	lank_ans[j]=lank_ans[j-1];
	lank_ans[j-1]=tmp;*/

	tmp=lank[j][0];
	lank[j][0]=lank[j-1][0];
	lank[j-1][0]=tmp;
	tmp=lank[j][1];
	lank[j][1]=lank[j-1][1];
	lank[j-1][1]=tmp;
      }
    }
  }

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

  return (0);
}