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<bits/stdc++.h>
using namespace std ;
typedef pair<int,int> pii ;
typedef pair<int,pii> pi3 ;

int n = 0 ;
int ans[3][120] = {0} ;

void sortSp( bool flg )
{
  vector<pi3> cmp ;
  int x = 0 ;
  int y = 0 ;
  int z = 2 ;

  if ( flg ) y = 1 ;
  else x = 1 ;

  for ( int i = 0 ; i < n ; i++ )
  {
    cmp.push_back( pi3( ans[x][i], pii( ans[y][i], ans[z][i] ) ) ) ;
  }

  if ( flg )
  {
    sort( cmp.begin(), cmp.end() ) ;
  }
  else
  {
    sort( cmp.begin(), cmp.end(), greater<pi3>() ) ;
  }

  for ( int i = 0 ; i < n ; i++ )
  {
    ans[x][i] = cmp[i].first ;
    ans[y][i] = cmp[i].second.first ;
    ans[z][i] = cmp[i].second.second ;
  }
}

void Rank()
{
  sortSp(0) ;

  for ( int i = 1 ; i <= n ; i++ )
  {
    int cmp = 0 ;
    ans[2][ i-1 ] = i ;
    for ( int j = i ; j < n ; j++ )
    {
      if ( ans[1][ i-1 ] == ans[1][j] )
      {
        ans[2][j] = i ;
        cmp++ ;
      }
      else break ;
    }
    i += cmp ;
  }

  sortSp(1) ;
}

void solve( int A, int B, int C )
{
  if ( !C )
  {
    ans[1][ A-1 ] += 1 ;
    ans[1][ B-1 ] += 1 ;
  }
  else
  {
    if ( C > 0 )
    {
      ans[1][ A-1 ] += 3 ;
    }
    else if ( C < 0 )
    {
      ans[1][ B-1 ] += 3 ;
    }
  }
}

int main()
{
  int A = 0 ;
  int B = 0 ;
  int score[2] = {0} ;
  cin >> n ;
  for ( int i = 1 ; i <= n ; i++ )
  {
    ans[0][ i-1 ] = i ;
  }
  for ( int i = 0 ; i < n*(n-1)/2 ; i++ )
  {
    cin >> A >> B >> score[0] >> score[1] ;
    solve( A, B, (score[0]-score[1]) ) ;
  }
  Rank() ;
  for ( int i = 0 ; i < n ; i++ )
  {
    printf("%d\n", ans[2][i]) ;
  }
  return 0 ;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void){

	int N;
	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++){
		int point1, point2, team1, team2;
		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++){
		if(i > 0 && log[i] == log[i-1]){continue;}
		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;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back

int data[200];

int main(){
    rep(i,200)data[i]=0;
    int n;
    cin>>n;
    rep(i,n*(n-1)/2){
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        if(c==d){
            data[a]++;
            data[b]++;
        }
        else if(c>d){
            data[a]+=3;
        }
        else if(c<d){
            data[b]+=3;
        }
    }
    vi s;
    rep(i,n){
        s.pb(data[i+1]);
    }
    sort(all(s),greater<int>());
    
    int rank[200];
    rep(i,200)rank[i]=-1;
    rep(i,n){
        for(int j=1;j<=n;j++){
            if(s[i]==data[j]&&rank[j]==-1){
                rank[j]=i+1;
            }
        }
    }
    for(int i=1;i<=n;i++){
        cout<<rank[i]<<endl;
    }
}

C++: #include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int main(){	
	int score[200],val,ctn[200];
	memset(score, 0, sizeof(score));
	memset(ctn, 0, sizeof(ctn));
	cin >> val;
	int a, b, c, d;
	for (int i = 0; i < val * (val-1); i++){
		cin >> a >> b >> c >> d;
		if (c < d)
			score[b-1] += 3;
		else if (c > d)
			score[a-1] += 3;
		else if (c == d){
			score[a-1]++;
			score[b-1]++;
		}
	}
	for (int a = 0; a < val; b++){
		for (int b = 0; b < val; b++){
			if (score[a] < score[b])
				ctn[a]++;
		}
	cout << ctn[a] << endl;
	}
}

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

int main() {
  int N; cin >> N;
  vector<pair<int ,int> > v(N);
  for(int i = 0; i < N; ++i) v[i].second = i;
  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) {
      v[a].first += 3;
    } else if(c < d) {
      v[b].first += 3;
    } else {
      v[a].first += 1;
      v[b].first += 1;
    }
  }
  sort(v.begin(), v.end(), greater<pair<int, int> >());
  vector<int> rank(N);
  for(int i = 0, k = 1; i < N; ++i) {
    if(i && v[i-1].first != v[i].first) k = i + 1;
    rank[v[i].second] = k;
  }
  for(int i = 0; i < N; ++i) {
    cout << rank[i] << endl;
  }
  return 0;
}

C++: #include<algorithm>
#include<iostream>
using namespace std;
int main(){
  int i,j;
  int n;
  cin>>n;
  pair<int,int> a[101];
  for(i=1;i<=n;++i)
    a[i]=make_pair(0,i);
  for(i=0;i<n*(n-1)/2;++i){
    int p,q,r,s;
    cin>>p>>q>>r>>s;
    if(false){
    }else if(r<s){
      a[q].first+=3;
    }else if(r>s){
      a[p].first+=3;
    }else{
      ++a[p].first;
      ++a[q].first;
    }
  }
  sort(a+1,a+n+1,greater<pair<int,int> >());
  for(i=1;i<=n;++i){
    for(j=1;a[j].second!=i;++j);
    for(;j>1&&a[j-1].first==a[j].first;--j);
    cout<<j<<endl;
  }
  return 0;
}