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(){
	int n,a,b,c,d,i,i2,p[100],m[100],t,l,r[100],aaa;
	scanf("%d",&n);
	for(i=0;i<=n;i++){
		p[i]=0;
		m[i]=0;
	}
	for(i=1;i<=n*(n-1)/2;i++){
		scanf("%d%d",&a,&b);
		m[a]++;
		m[b]++;
		scanf("%d%d",&c,&d);
		if(c>d){
			p[a]+=3;
		}
		else if(c<d){
			p[b]+=3;
		}
		else{
			p[a]++;
			p[b]++;
		}
	}
	for(i=1;i<=n;i++){
		m[i]=i;
	}
	for(i=1;i<=n;i++){
		for(i2=1;i2<=n;i2++){
			if(p[i]>p[i2]){
				t=p[i];
				p[i]=p[i2];
				p[i2]=t;
				t=m[i];
				m[i]=m[i2];
				m[i2]=t;
			}
		}
	}
	/*for(i=1;i<=n;i++){
		printf("%d %d\n",m[i],p[i]);
	}*/
	l=1;
	aaa=0;
	for(i=1;i<=n;i++){
		r[m[i]]=l;
		if(p[i]==p[i+1]){
			aaa++;
		}
		else{
			l=l+aaa+1;
			aaa=0;
		}
	}
	for(i=1;i<=n;i++){
		printf("%d\n",r[i]);
	}
}

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

int main(){
    int n;
    cin >> n;
    int score[100];
    for(int i=0; i < 100; i++) score[i] = 0;
    for(int i=0; i <n*(n-1)/2; i++){
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        if(c < d){
            score[a] += 0;
            score[b] += 3;
        }
        else if(c > d){
            score[a] += 3;
            score[b] += 0;
        }
        else {
            score[a] += 1;
            score[b] += 1;
        }
    }
    set<int> s;
    for(int i=1; i <= n; i++){
        s.insert(score[i]);
    }

    int result[100];
    set<int>::reverse_iterator it = s.rbegin();
    int count = 1;
    while( it != s.rend() )
    {
        int term = 0;
        for(int j=1; j <= n; j++){
            if(*it == score[j]){ result[j] = count; term++;}
        }
        it++;
        count+=term;
    }
    for(int i=1; i <= n; i++) cout << result[i] << endl;
}

C++: // tsukasa_diary's programing contest code template
#include <bits/stdc++.h>
using namespace std;
// define
#define for_(i,a,b) for(int i=a;i<b;++i)
#define for_rev(i,a,b) for(int i=a;i>=b;--i)
#define allof(a) a.begin(),a.end()
#define minit(a,b) memset(a,b,sizeof(a))
#define size_of(a) (int)a.size()
// typedef
typedef long long lint;
typedef double Double;
typedef pair<int, int> pii;
//
typedef vector< int > Array;
typedef vector< Array > Matrix;
typedef vector< Double > DArray;
typedef vector< DArray > DMatrix;
typedef vector< string > SArray;
typedef vector< pii > PArray;
// popcount
inline int POPCNT(int _x) { return __builtin_popcount(_x); }
inline int POPCNT(lint _x) { return __builtin_popcountll(_x); }
// inf
const int iINF = 1L << 30;
const lint lINF = 1LL << 60;
// eps
Double EPS = 1e-9;
// in range
inline bool in_range(int _v, int _mx, int _mi) { return _mi <= _v && _v < _mx; }
inline bool in_range(Double _v, Double _mi, Double _mx) { return -EPS < _v - _mi && _v - _mx < EPS; }
inline bool in_range(int _x, int _y, int _W, int _H) { return 0 <= _x && _x < _W && 0 <= _y && _y < _H; }
// neighbor clockwise
const int DX[4] = {0,1,0,-1}, DY[4] = {-1,0,1,0};
const int DX_[8] = {0,1,1,1,0,-1,-1,-1}, DY_[8] = {-1,-1,0,1,1,1,0,-1};

int N;

void solve() {
	int rep = N * (N - 1) / 2;
	
	Array win(N);
	for_(i,0,rep) {
		int a, b, c, d; cin >> a >> b >> c >> d;
		--a; --b;
		if (c > d) win[a] += 3;
		else if (c < d) win[b] += 3;
		else ++win[a], ++win[b];
	}
	
	Array swin = win;
	sort(allof(swin));
	
	for_(i,0,N) {
		int v = win[i];
		int rank = swin.end() - upper_bound(allof(swin), v);
		cout << rank + 1 << endl;
	}
}

int main() {
	cin >> N;
	solve();
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n,i,a,s,d,f,x[101],w[101],q[101],j,o;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		x[i]=0;
		w[i]=0;
		q[i]=0;
	}	
	for(i=1;i<=n*(n-1)/2;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]);
	}	
	return 0;	
}

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

using namespace std;
int main()
{
    int n;
    cin >> n;
    int a,b,c,d;
    int aa[n];
    for(int i=0;i<n;i++){
        aa[i]=0;
    }
    for(int i=0;i<n*(n-1)/2;i++){
        cin >> a >> b >> c >> d;
        if(c>d){
            aa[a-1]+=3;
        }else if(c==d){
            aa[a-1]+=1;
            aa[b-1]+=1;
        }else{
            aa[b-1]+=3;
        }
    }
    int j=1;
    int x[n];
    for(int i=0;i<n;i++){
        x[i]=1;
    }
    for(int i=0;i<n-1;i++){
        for(int j=i+1;j<n;j++){
            if(aa[i]<aa[j]){
                x[i]++;
            }else if(aa[i]>aa[j]){
                x[j]++;
            }
        }
    }
    for(int i=0;i<n;i++){
        cout << x[i] << endl;
    }
    return 0;
}

C++: #include <stdio.h>
#include <iostream>

using namespace std;

int main() {

	int n;
	int kaisu;
	int team[100][3] = {0};
	int teamn[100];
	int a,b,c,d;
	int kari;
	int juni = 1;
	int counter = 1;
	
	cin >> n;
	kaisu = n * (n - 1) / 2;

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

	for (int i = 0; i < kaisu; i++) {
		cin >> a >> b >> c >> d;
		if (c > d) {
			team[a-1][1] += 3;
		} else if ( c < d) {
			team[b-1][1] += 3;
		} else {
			team[a-1][1] += 1;
			team[b-1][1] += 1;
		}
	}

	for (int i = n-1; i > 0; i--) {
		for (int j = 0; j < i; j++) {
			if (team[j][1] < team[j+1][1]) {
				for (int k = 0; k < 2; k++) {
					kari = team[j][k];
					team[j][k] = team[j+1][k];
					team[j+1][k] = kari;
				}
			}
		}
	}

	for (int i = 0; i < n; i++) {
		team[i][2] = juni;
		if (team[i][1] > team[i+1][1]) {
			juni += counter;
			counter = 1;
		} else {
			counter++;
		}
	}

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			if (team[j][0] == i) {
				cout << team[j][2] << endl;
				break;
			}
		}
	}
	return 0;
}

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

int main(void){
  int n,team1,team2,Point[101],po1,po2,cnt;

  for( int i = 0 ; i < 101 ; i++ ) Point[i] = 0;
  
  cin >> n;
  for( int i = 0; i < n*(n-1)/2 ; i++ ){

      cin >> team1 >> team2 >> po1 >> po2;
      if( po1 > po2 ) Point[team1] += 3;
      else if( po1 < po2 ) Point[team2] += 3;
      else{
	Point[team1]++; Point[team2]++;
      }
      }

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