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 <vector>
#include <algorithm>
using namespace std;
int main(void){

	int N, point1, point2, team1, team2;
	cin >> N;
	int score[N], rank[N];
	vector<int> log;
	for(int i = 0; i < N; i++){
		score[i] = 0;
		rank[i] = 0;
	}

	for(int i = 0; i < (N*(N-1))/2; i++){
		cin >> team1 >> team2 >> point1 >> point2;
		if(point1 == point2){
			score[team1-1]++;
			score[team2-1]++;
		}else if(point1 < point2){
			score[team2-1] += 3;
		}else if(point1 > point2){
			score[team1-1] += 3;
		}
	}
	for(int i = 0; i < N; i++){
		log.push_back( score[i] );
	}
	sort(log.begin(), log.end(),greater<int>());

	for(int i = 0; i < N; i++){
		for(int j = 0; j < N; j++){
			if(log[i] >= score[j]){
				rank[j]++;
			}
		}
	}
	for(int i = 0; i < N; i++){
		cout << rank[i] << endl;
	}

	return 0;
}

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

#define times(n, i)      uptil(0, n, i)
#define upto(f, t, i)    for(decltype(t) _##i = (t), i = (f); i <= _##i; i++)
#define uptil(f, t, i)   for(decltype(t) _##i = (t), i = (f); i < _##i; i++)
#define downto(f, t, i)  for(decltype(t) _##i = (t), i = (f); i >= _##i; i--)
#define downtil(f, t, i) for(decltype(t) _##i = (t), i = (f); i > _##i; i--)
#define unless(c) if(!(c))
#define until(c) while(!(c))
#define loop while(true)

#define all(v) v.begin(), v.end()
#define ln << "\n"

struct line{};

template<class T> istream& operator>>(istream& in, vector<T>& v) {
    times(v.capacity(), i) in >> v[i];
    return in;
}

template<class T> const ostream& operator<<(ostream& out, const vector<T>& v) {
    times(v.size(), i) out << (i ? " " : "") << v[i];
    return out;
}

template<class T, class...U> typename enable_if<is_same<T, line>::value, string>::type next(istream& in, const U&... args) {
    string s;
    getline(in, s, args...);
    return move(s);
}

template<class T, class...U> typename enable_if<!is_same<T, line>::value, T>::type next(istream& in, const U&... args) {
    T t(args...);
    in >> t;
    return move(t);
}
template<class T, class...U> auto next(const U&... args) -> decltype(next<T>(cin)) {
    return next<T>(cin, args...);
}

template<class T> T sum(const vector<T>& v) {
    T ans = T();
    for(const T& t : v) ans += t;
    return ans;
}

template<class T> T sum(const typename vector<T>::iterator& begin, const typename vector<T>::iterator& end) {
    T ans = T();
    for(typename vector<T>::iterator t = begin; t != end; t++) ans += *t;
    return ans;
}

template<class T> T min(const vector<T>& v) {
    return *min_element(v.begin(), v.end());
}

template<class T> T min(const typename vector<T>::iterator& begin, const typename vector<T>::iterator& end) {
    return *min_element(begin, end);
}

template<class T> T max(const vector<T>& v) {
    return *max_element(v.begin(), v.end());
}

template<class T> T max(const typename vector<T>::iterator& begin, const typename vector<T>::iterator& end) {
    return *max_element(begin, end);
}

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

    auto N = next<int>();
    vector<int> point(N, 0);
    times(N * (N - 1) / 2, i) {
        auto A = next<int>() - 1, B = next<int>() - 1, C = next<int>(), D = next<int>();
        if(C > D) {
            point[A] += 3;
        } else if(C < D) {
            point[B] += 3;
        } else {
            point[A]++;
            point[B]++;
        }
    }
    vector<int> point_(N, 0), rank(N);
    times(N, i) point_[i] = point[i];
    sort(all(point_), greater<int>());
    int p_ = 0;
    #ifdef debug
        times(N, i) cout << point[i] ln;
        cout ln;
        times(N, i) cout << point_[i] ln;
        cout ln;
    #endif
    times(N, i) {
        int p = point_[i];
        if(p == p_) continue;
        p_ = p;
        times(N, j) {
            if(p == point[j]) {
                rank[j] = i + 1;
            }
        }
    }
    times(N, i) cout << rank[i] ln;

    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
const int INF=-5;
int main(){
	int n,ten[107]={0};
	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)ten[a]+=3;
		else if(c<d)ten[b]+=3;
		else ten[a]++,ten[b]++;
	}
	//for(int i=1;i<=n;i++)cout<<ten[i];
	int same=0;vector<int>s;int kekka[107]={0};
	int tenpu=0;
	for(int i=1;i<=n;i++){
	//	if(kekka[i]!=0)continue;
		int tmp=INF,tmpj=INF;//暫定一位
		for(int j=1;j<=n;j++){
			if(tmp<ten[j]){
			tmp=ten[j];
			tmpj=j;
			}
		}
		kekka[tmpj]=i;
		ten[tmpj]=INF;
		//この時点で、tmpは残っている中で一位
		for(int j=1;j<=n;j++){
			if(tmpj!=j&&tmp==ten[j]){//暫定一位とは別の同じお特典があったら
				kekka[j]=i;i++;
				ten[j]=INF;
			}
		}
	//	cout<<kekka[1]<<kekka[2]<<kekka[3]<<kekka[4]<<endl;
	}
	for(int i=1;i<=n;i++)cout<<kekka[i]<<endl;
	return 0;
}

C++: #include <cstring>
#include <string>
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int N;
	cin >> N;

	int** gresult = new int*[N + 1];
	for (int i = 1; i <= N; i++) {
		gresult[i] = new int[N + 1];
	}

	int numGame = N * (N - 1) / 2;
	int* tScore = new int[N + 1];
	for (int i = 0; i < numGame; i++) {
		int a, b, scoreA, scoreB;
		cin >> a >> b >> scoreA >> scoreB;

		if (scoreA == scoreB) {
			tScore[a] += 1;
			tScore[b] += 1;
		} else if (scoreA > scoreB) {
			tScore[a] += 3;
		} else if (scoreA < scoreB) {
			tScore[b] += 3;
		}
	}

	int* tRank = new int[N + 1];
	for (int i = 1; i <= N; i++) {
		tRank[i] = 1;
	}
	for (int i = 2; i <= N; i++) {
		for (int j = 1; j <= i - 1; j++) {
			if (tScore[i] > tScore[j]) tRank[j]++;
			if (tScore[i] < tScore[j]) tRank[i]++;
		}
	}

	for (int i = 1; i <= N; i++) {
		cout << tRank[i] << endl;
	}

	return 0;
}

C++: #include <stdio.h>
int main(void)
{
	int n,i,j,temp,a,b,c,d,e[100],f[100],g[100];
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		e[i]=0;
		f[i]=i;
	}
	for(i=0;i<n*(n-1)/2;i++){
		scanf("%d %d %d %d",&a,&b,&c,&d);
		if(c>d){
			e[a]=e[a]+3;
		}
		else if(c<d){
			e[b]=e[b]+3;
		}
		else if(c==d){
			e[a]=e[a]+1;
			e[b]=e[b]+1;
		}
	}
	for(i=1;i<=n;i++){
		g[i]=e[i];
	}
	for(i=0;i<n;i++){
		for(j=n;j>i+1;j--){
			if(e[j]>e[j-1]){
				temp=e[j];
				e[j]=e[j-1];
				e[j-1]=temp;
			}
		}
	}
	for(j=2;j<=n;j++){
		if(e[j]==e[j-1]){
			f[j]=f[j-1];
		}
	}
	for(i=1;i<=n;i++){
		for(j=1;j<=n;j++){
			if(g[i]==e[j]){
				printf("%d\n",f[j]);
				break;
			}
		}
	}
	return 0;
}