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 <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define TO_STRING(a) #a
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }
template<class T> void MSG(T a){ cout << TO_STRING(a) << " = " << a << endl; }
 
 
 
int main()
{
        int n;
        cin >> n;
 
        vint score(n);
        fill(score.begin(), score.end(), 0);
 
        rep(i, n*(n-1)/2)
        {
                int a, b, c, d;
                cin >> a >> b >> c >> d;
 
                score[a-1] += (c > d ? 3 :(c == d ? 1 : 0));
                score[b-1] += (c < d ? 3 :(c == d ? 1 : 0));
        }
 
        rep(print, n)
        {
                int rank = 1;
                rep(over, n)
                        if(score[print] < score[over])
                                rank++;
 
                cout << rank << endl;
        }
}

clone edit download c

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
 
using namespace std;
 
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)

long gcd(long a, long b){
	if (a%b==0){
		return b;
	}
	else{
		return gcd(b,a%b);
	}
}
 
long lcm(long a, long b){
	return (a*b) / gcd(a,b);
}
 
typedef long long ll;
 
const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS = 1e-10;

int score[100][100];
int sum[100];
int tmp[100];
int f[100];
int rank[100];

int main(){
	int n;
	
	cin >> n;
	
	int game = n*(n-1)/2;
	
	REP(i,game){
		int a, b, c, d;
		
		cin >> a >> b >> c >> d;
		
		a--; b--;
		
		if (c > d){
			score[a][b] = 3;
			score[b][a] = 0;
		}
		else if (c < d){
			score[a][b] = 0;
			score[b][a] = 3;
		}
		else {
			score[a][b] = 1;
			score[b][a] = 1;
		}
	}
	
	int ma = 0;
	
	REP(i,n){
		REP(j,n){
			sum[i] += score[i][j];
		}
		tmp[i] = sum[i];
	}
	
	sort(tmp,tmp+n);
	
	REP(i,n){
		REP(j,n){
			if (f[j] == 0 && tmp[n-i-1] == sum[j]){
				f[j] = 1;
				rank[j] = i+1;
			}
		}
	}
	
	REP(i,n){
		cout << rank[i] << endl;
	}
	
	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
  int n;
  cin>>n;
  pair<int,int> data[n];
  for(int i=0;i<n;i++)
    {
      data[i]=make_pair(0,i+1);
    }
  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)
	data[a].first+=3;
      else if(c<d)
	data[b].first+=3;
      else
	{
	  data[a].first+=1;
	  data[b].first+=1;
	}
    }
  sort(data,data+n,greater<pair<int,int> >());

  int rank=1;
  int tmp;
  int ans[n];
  for(int i=1;i<=n;i++)
    {
      if(tmp!=data[i-1].first)
	rank=i;
      tmp=data[i-1].first;
      
      ans[data[i-1].second-1]=rank;
    }
  for(int i=0;i<n;i++)
    {
      cout<<ans[i]<<endl;
    }

}

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

int n;
int a, b, c, d;
int score[200], rank[200]={0};

int main(void)
{
    scanf("%d\n", &n);
    for(int i=0; i< n*(n-1)/2; i++) {
        scanf("%d %d %d %d", &a, &b, &c, &d);
        if(c > d)
            score[a] += 3;
        else if(c < d)
            score[b] += 3;
        else {
            score[a]++; score[b]++;
        }
    }
    for(int i=1; i<=n; i++) rank[i] = 1;
    for(int i=1; i<=n; i++)
        for(int j=1; j<=n; j++)
            if(score[i] < score[j]) rank[i]++;

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

    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;
	for (int i = 0; i < numGame; i++) {
		int a, b, scoreA, scoreB;
		cin >> a >> b >> scoreA >> scoreB;

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

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

	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<iostream>
#include<algorithm>
#include<vector>
#include<functional>
using namespace std;

int main()
{
	int n, team1, team2, score1, score2, point[101] = {0};
	vector<int> rank;
	cin >> n;
	for(int i = 0; i < n * (n - 1) / 2; i++){
		cin >> team1 >> team2 >> score1 >> score2;
		if(score1 > score2)
			point[team1] += 3;
		else if(score1 < score2)
			point[team2] += 3;
		else{
			point[team1]++;
			point[team2]++;
		}
	}

	for(int i = 0; i < n; i++)
		rank.push_back(point[i + 1]);

	stable_sort(rank.begin(), rank.end(), greater<int>());

	for(int i = 1; i <= n; i++){
		for(int j = 0; j < n; j++){
			if(point[i] == rank[j]){
				cout << j + 1 << endl;
				break;
			}
		}
	}

	return 0;
}