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<functional>
#include<algorithm>

using namespace std;

int main()
{
	int n;
	int score[100];
	int win[100];
	int gameteam1[10000];
	int gameteam2[10000];
	int t1score[10000];
	int t2score[10000];
	pair<pair<int, int>,pair<int,int> > sorter[100];
	pair<int, int> answer[100];

	for (int a = 0; a < 100; a++)
	{
		score[a] = 0;
		win[a] = 0;
	}

	for (int a = 0; a < 10000; a++)
	{
		gameteam1[a] = 0;
		gameteam2[a] = 0;
		t1score[a] = 0;
		t2score[a] = 0;
	}

	cin >> n;

	for (int a = 0; a < n*(n - 1) / 2; a++)
	{
		cin >> gameteam1[a] >> gameteam2[a] >> t1score[a] >> t2score[a];
	}

	for (int a = 0; a < n*(n - 1) / 2; a++)
	{
		if (t1score[a] == t2score[a])
		{
			score[gameteam1[a]-1]++;
			score[gameteam2[a]-1]++;
		}
		else
		{
			if (t1score[a] > t2score[a])
			{
				score[gameteam1[a]-1] += 3;
				win[gameteam1[a]-1]++;
			}
			else if (t1score[a] < t2score[a])
			{
				score[gameteam2[a]-1] += 3;
				win[gameteam2[a]-1]++;
			}
		}
	}

	for (int a = 0; a < n; a++)
	{
		sorter[a] = make_pair(make_pair(win[a], score[a]),make_pair(10000,a));
	}

	sort(sorter, sorter + n,greater<pair<pair<int,int>,pair<int,int> > >());

	sorter[0].second.first = 1;

	for (int a = 1; a < n; a++)
	{
		if (sorter[a].first.second == sorter[a - 1].first.second)
		{
			sorter[a].second.first = sorter[a - 1].second.first;
		}
		else
		{
			sorter[a].second.first = a + 1;
		}
	}

	for (int a = 0; a < n; a++)
	{
		answer[a] = make_pair(sorter[a].second.second, sorter[a].second.first);
	}

	sort(answer, answer + n);

	for (int a = 0; a < n; a++)
	{
		cout << answer[a].second << endl;
	}


	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int n,i,i2,match[101],point[101],team[101],lunk[101],ans[101],cnt=1,cntout=0,j=0,a,b,c,d,toread;
	cin>>n;
	for(i=0;i<=n;i++){
		point[i]=0;
		match[i]=0;
		team[i]=i;
	}
	while(j!=n){
		cin>>a>>b>>c>>d;
		match[a]++;
		match[b]++;
		if(c>d){
			point[a]+=3;
		}
		else if(c<d){
			point[b]+=3;
		}
		else{
			point[a]++;
			point[b]++;
		}
		j=0;
		for(i=1;i<=n;i++){
			if(match[i]==n-1){
				j++;
			}
		}
	}
	for(i=1;i<=n;i++){
		for(i2=1;i2<=n;i2++){
			if(point[i]>point[i2]){
				toread=point[i];
				point[i]=point[i2];
				point[i2]=toread;
				toread=team[i];
				team[i]=team[i2];
				team[i2]=toread;
			}
		}
	}
	for(i=1;i<n;i++){
		lunk[i]=cnt;
		if(point[i]==point[i+1]){
			cntout++;
		}
		else{
			cnt+=cntout+1;
			cntout=0;
		}
	}
	lunk[i]=cnt;
	for(i=1;i<=n;i++){
		ans[team[i]]=lunk[i];
	}
	for(i=1;i<=n;i++){
		cout<<ans[i]<<endl;
	}
}

C++: #include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int v[101],ans[1000001],cc=1,k;
int main(){
	int n,a,b,c,d;
	cin>>n;
	r(i,(n*(n-1))/2){
		cin>>a>>b>>c>>d;
		a--,b--;
		if(c==d)v[a]++,v[b]++;
		else if(c>d)v[a]+=3;
		else v[b]+=3;
	}
	vector<int>p;
	r(i,n)p.push_back(v[i]);
	sort(p.begin(),p.end(),greater<int>());
	r(i,n){
		if(!i)ans[p[i]]=cc,k++;
		else{
			if(p[i]!=p[i-1])cc+=k,k=0;
			ans[p[i]]=cc,k++;
		}
	}
	r(i,n)cout<<ans[v[i]]<<endl;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
bool flag[10000000];
int main(void) {
  int N;
  int T1, T2, P1, P2;
  int cnt[100]={0};
  int R = 0;
  int j = 0;
  while(cin >> N) {
    memset(cnt, 0, sizeof(cnt));
    for(int i = 0 ; i < N*(N-1)/2 ; i++) {
      cin >> T1 >> T2 >> P1 >> P2;
      if(P1 > P2) cnt[T1] += 3; 
      else if(P1 < P2) cnt[T2] += 3;
      else if(P1 == P2) { cnt[T1]++; cnt[T2]++; }	
    }
    /*for(int i = 1 ; i <= N ; i++) {
      cout << cnt[i] << ' ';
    }
    cout << endl;*/
    for(int i = 1 ; i <= N ; i++) {
      for(int j = 1 ; j <= N ; j++) {
	  if(cnt[i] < cnt[j]) R++;
      }
      cout << R+1 << endl;
      R = 0;
    }
    //cout << endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int v[101],ans[101],cc=1,k;
int main(){
	int n,a,b,c,d;
	cin>>n;
	r(i,(n*(n-1))/2){
		cin>>a>>b>>c>>d;
		a--,b--;
		if(c==d)v[a]++,v[b]++;
		else if(c>d)v[a]+=3;
		else v[b]+=3;
	}
	vector<int>p;
	r(i,n)p.push_back(v[i]);
	sort(p.begin(),p.end(),greater<int>());
	r(i,n){
		if(!i)ans[p[i]]=cc,k++;
		else{
			if(p[i]!=p[i-1])cc+=k,k=0;
			ans[p[i]]=cc,k++;
		}
	}
	r(i,n)cout<<ans[v[i]]<<endl;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
    int n,a,b,pa,pb,point[100];
 
        for(int i = 0;i < 101;++i){
            point[i] = 0;
        }
        for(int i = 0;i < ((n*(n-1))/2);++i){
            cin >> a >> b >> pa >> pb;
            --a; --b;
            if(pa > pb) point[a] += 3;
            else if(pa < pb) point[b] += 3;
            else {
                ++point[a];
                ++point[b];
            }
        }
        for(int i = 0;i < n;++i){
            a = 1;
            pa = point[i];
            for(int j = 0;j < n;++j){
                if(pa < point[j] && i != j) ++a;
            }
            cout << a << endl;
        }
    return 0;
}