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++: import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int a[] = new int[10000];
		int b[] = new int[10000];
		for(int i = 1; i <= n*(n-1)/2; i++){
			for(int h = 1; h <= 4; h++){
				b[h] = in.nextInt();
			}
			if(b[3] > b[4]){
				a[b[1]] += 3;
			}else if(b[3] < b[4]){
				a[b[2]] += 3;
			}else if(b[3] == b[4]){
				a[b[1]] += 1;
				a[b[2]] += 1;
			}
		}
		for(int j = 1; j <= n; j++){
			int an = n;
			for(int k = 1; k <= n; k++){
				if(j == k){
					continue;
				}else if(a[j] >= a[k]){
					an--;
				}
			}
			System.out.println(an);
		}
	}

}

C++: #include "bits/stdc++.h"
#define rep(i,a,n) for(int i = (a);i < (n);i++)
typedef unsigned long long ull;
typedef long long ll;
using namespace std;

int main(){
    int n,a,b,c,d,cnt = 0,memo = 1;
    cin >> n;
    int pts[n] = {0},rank[n];
    
    rep(i,0,n*(n-1)/2){
        cin >> a >> b >> c >> d;
        
        if(c > d) pts[a-1] += 3;
        else if(c < d) pts[b-1] += 3;
        else{
            pts[a-1]++;
            pts[b-1]++;
        }
        
        
    }
    
    for(int i = 300; i >= 0;i--){
        cnt = 0;
        
        rep(j,0,n){
            if(pts[j] == i){
                rank[j] = memo;
                cnt++;
            }
        }
        
        memo += cnt;
        
    }
    
    rep(i,0,n){
        
        cout << rank[i]  << endl;
    }
    
    
    
    
    return 0;   
}

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

    int n;
    cin >> n;
    int a,b,c,d;
    int score[1000]={0};
    int count=0;
    for(int i=0;i<n*(n-1)/2;i++){
        cin>>a>>b>>c>>d;
        if(c>d)score[a]+=3;
        else if(c<d)score[b]+=3;
        else if(c==d)score[a]++,score[b]++;

    }
    for(int i=1;i<=n;i++){
        count = 1;
        for(int j=1;j<=n;j++){
            if(score[i]<score[j])count++;
        }
        cout<<count<<endl;
    }


    return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
const static int TEAM_MAX = 100;

struct winp_data {
  int team_id;
  int point;
};
bool operator < ( const winp_data &wp1, const winp_data &wp2 ) {
  if( wp1.point == wp2.point ) {
    return wp1.team_id < wp2.team_id;
  } 
  return wp1.point < wp2.point;
}

int main() {
  int n;
  winp_data win_p [ TEAM_MAX ];
  int rank_data[ TEAM_MAX ];
  cin >> n;
  for( int i = 0; i < n; i++ ) {
    win_p[ i ].team_id = i + 1;
    win_p[ i ].point = 0;
  }
  int combinum = n * ( n - 1 ) / 2;
  for( int i = 0; i < combinum; i++ ) {
    int a, b, ap, bp;
    cin >> a >> b >> ap >> bp;
    if( ap > bp ) {
      win_p[ a - 1 ].point += 3;
    } else if( ap == bp ) {
      win_p[ a - 1 ].point += 1;
      win_p[ b - 1 ].point += 1;
    } else {
      win_p[ b - 1 ].point += 3;
    }
  }

  sort( win_p, win_p + n );
  int rank = 1;
  int frank = 1;
  int prev_p = -1;
  for( int i = n - 1; i >= 0; i-- ) {
    if( prev_p != win_p[ i ].point ) {
      rank = frank;
    }
    frank++;
    rank_data[ win_p[ i ].team_id - 1 ] = rank;
    prev_p = win_p[ i ].point;
  }

  for( int i = 0; i < n; i++ ) {
    cout << rank_data[ i ] << endl;
  }
  return EXIT_SUCCESS;
}

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++){
		int tmp=INF,tmpj=INF;//暫定一位
		for(int j=1;j<=n;j++){
			if(ten[j]==INF)continue;
			if(tmp<ten[j]){
			tmp=ten[j];
			tmpj=j;
			//kekka[j]=i;
			}
		}
		kekka[tmpj]=i;
		ten[tmpj]=INF;
		//この時点で、tmpは残っている中で一位
		for(int j=1;j<=n;j++){
			if(ten[j]==INF)continue;
			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<iostream>
#include<vector>
#include<algorithm>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int N;
	cin>>N;
	long long result[N];
	rep(i,N)result[i]=0;
	long long a,b,c,d;
	rep(i,N*(N-1)/2){
		cin>>a>>b>>c>>d;
		a--;
		b--;
		if(c>d){
			result[a]+=3;
		}else if(c<d){
			result[b]+=3;
		}else{
			result[a]++;
			result[b]++;
		}
	}
	int team[N];
	rep(i,N)team[i]=i+1;
	/*rep(i,N){
		cout<<team[i]<<" "<<result[i]<<endl;
	}*/
	//cout<<endl;
	for(int i=N;i>=1;i--){
		for(int j=0;j<i-1;j++){
			if(result[j]<result[j+1]){
				int alt=result[j];
				result[j]=result[j+1];
				result[j+1]=alt;
				alt=team[j];
				team[j]=team[j+1];
				team[j+1]=alt;
			}
			//rep(i,N)cout<<team[i]<<" ";
			//cout<<endl;
		}
	}
	int rank[N];
	rep(i,N){
		rank[i]=i+1;
	}
	for(int i=N;i>=1;i--){
		for(int j=0;j<i-1;j++){
			if(team[j]>team[j+1]){
				int alt=result[j];
				result[j]=result[j+1];
				result[j+1]=alt;
				alt=team[j];
				team[j]=team[j+1];
				team[j+1]=alt;
				alt=rank[j];
				rank[j]=rank[j+1];
				rank[j+1]=alt;
			}
		}
	}
	//rep(i,N)cout<<team[i]<<" "<<result[i]<<" "<<rank[i]<<endl;
	//cout<<endl;
	int check[N];
	rep(i,N)check[i]=0;
	int cnt=1;
	rep(i,N){
		rep(j,N){
			if(result[i]==result[j] && i!=j){
				//cout<<"hit "<<i<<" "<<j<<endl;
				check[i]=cnt;
				check[j]=cnt;
				cnt++;
			}
		}
	}
	//rep(i,N)cout<<team[i]<<" "<<result[i]<<" "<<rank[i]<<" "<<check[i]<<endl;
	//cout<<endl;
	rep(i,N){
		if(check[i]){
			rep(j,N){
				if(check[i]==check[j]){
					if(rank[i]>rank[j]){
						rank[i]=rank[j];
					}else{
						rank[j]=rank[i];
					}
				}
			}
		}
	}
	rep(i,N)cout<<rank[i]<<endl;
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(void){
int a, b=0, c, d, e[100]={0}, g[100]={0}, i, j, f,k;
cin >> a;
b=a*(a-1)/2;
cout << b << endl;
	for(i=1;i<=b;i++){
		cin >> c >> d >> f >> k;
		if(f > k){
			g[c] = g[c] + 3;
		}
		else if(k > f){
			g[d] = g[d] + 3;
		}
		else{
			g[c]++;
			g[d]++;
		}
	}
	for(i=1;i<=a;i++){
		for(j=1;j<=a;j++){
			if(g[i]<g[j]){
				 e[i]++;
			}
		}
	}
	for(i=1;i<=a;i++){
	e[i]++;
	cout << e[i] << endl;
	}
}