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>
using namespace std;
int main(){
	int N,n[110]={},cnt=1,A,B,C,D;
	cin>>N;
	for(int i=0;i<N*(N-1)/2;i++){
		cin>>A>>B>>C>>D;
		if(C==D){
			n[A]+=1;
			n[B]+=1;
		}
		if(C>D){
			n[A]+=3;
		}
		if(D>C){
			n[B]+=3;
		}
	}
	for(int i=1;i<=N;i++){
		cnt=1;
		for(int j=1;j<=N;j++){
			if(i!=j && n[i]<n[j]){
				cnt++;
			}
		}
		cout<<cnt<<endl;
	}
	return 0;
}

C++: //http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0566
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<algorithm>
int main(){
	int N;
	scanf("%d", &N);
	int point[101] = { 0 };
	for (int i = 0; i < N * (N - 1) / 2; ++i){
		int a, b, c, d;
		scanf("%d %d %d %d", &a, &b, &c, &d);
		if (c>d)point[a-1] += 3;
		else if (d>c)point[b-1] += 3;
		else point[a-1]++, point[b-1]++;
	}
	int rank[101];
	for (int i = 0; i < N; ++i)rank[i] = point[i];
	std::sort(rank, rank + N);
	bool flag[101] = { true };
	int ans[101];
	int r = 1;
	for (int i = N - 1; i >= 0; --i){
		int cnt = 0;
		for (int j = 0; j < N; ++j){
			if (point[j] == rank[i]){
				cnt++;
				ans[j] = r;
			}
		}
		if (cnt>1){
			i -= cnt - 1;
			r += cnt - 1;
		}
		r++;
		
	}
	for (int i = 0; i < N; ++i){
		std::cout << ans[i] << std::endl;
	}
	return 0;
}

C++: #include<stdio.h>
int main()
{
	int a[1001] = { 0 }, b[1001] = { 0 }, c[1001] = { 0 }, d[1001] = { 0 },hideo, masatoy, nagase,ruio=0,temp=0;
	scanf("%d", &hideo);
	nagase = hideo*(hideo - 1) / 2;
	for (int i = 1; i <= hideo; i++) {
		c[i] = i;
	}
	for (int i = 1; i <= nagase; i++) {
		scanf("%d %d %d %d", &a[1], &a[2], &a[3], &a[4]);
		if (a[3] > a[4]) {
			b[a[1]] += 3;
		}
		else if (a[3] < a[4]) {
			b[a[2]] += 3;
		}
		else {
			b[a[1]] += 1;
			b[a[2]] += 1;
		}
	}
	for (int i = 1; i <= hideo; i++) {
		for (int j = 1; j <= hideo; j++) {
			if (b[j] > ruio) {
				ruio =b[j];
			}
		}
		for (int j = 1; j <= hideo; j++) {
			if (b[j] == ruio) {
				if (ruio != -1) {
					d[j] = i;
					b[j] = -1;
					temp++;
				}
			}
		}
		if (temp >1)i++;
		temp = 0;
		ruio = -1;
	}
	/*for (int i = 1; i <= hideo; i++) {
		for (int j = hideo; j > i; j--) {
			if (b[j] > b[j - 1]) {
				masatoy = b[j];
				b[j] = b[j - 1];
				b[j - 1] = masatoy;
				masatoy = c[j];
				c[j] = c[j - 1];
				c[j - 1] = masatoy;
			}

			
		}
	}*/
	for (int i = 1; i <= hideo; i++) {
		printf("%d\n", d[i]);
	}
}

C++: //============================================================================
// Name        : JOI.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;
int A[101],B[101],C[101],D[101];
int N,M;
int S[101]={};
int main() {
	cin>>N;
	for(int i=0;i<(N*(N-1)/2);i++){
		cin>>A[i]>>B[i]>>C[i]>>D[i];
	}
	for(int i=0;i<(N*(N-1)/2);i++){
		if(C[i]>D[i])S[A[i]]+=3;
		if(C[i]<D[i])S[B[i]]+=3;
		if(C[i]==D[i])S[A[i]]+=1,S[B[i]]+=1;
	}

	int T=0;
	for(int i=1;i<N+1;i++){
		T=1;
		for(int j=1;j<N+1;j++){
			if(S[i]<S[j])T+=1;
		}
		cout<<T<<endl;

	}
	return 0;
}

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

using namespace std;


struct Data
{
	int team1 , team2;
	int point1 , point2;
};



int main(void)
{
	int point[110] = {0};
	int zyuni[110] = {0};
	
	struct Data data;

	int n;

	cin >> n;

	for (int i = 0; i < n * (n - 1) / 2; i++)
	{
		cin >> data.team1 >> data.team2 >> data.point1 >> data.point2;
		if (data.point1 == data.point2)
		{
			point[data.team1 - 1]++;
			point[data.team2 - 1]++;
		}
		else if (data.point1 > data.point2)
		{
			point[data.team1 - 1] += 3;
		}
		else
		{
			point[data.team2 - 1] += 3;
		}
	}

	bool flag = true;
	int cnt = 1;
	while (flag)
	{
		flag = false;

		int m = -1;
		for (int i = 0; i < n; i++)
		{
			m = max(m , point[i]);
		}
		if (m == -1)
		{
			break;
		}
		int now = 0;
		for (int i = 0; i < n; i++)
		{
			if (m == point[i])
			{
				zyuni[i] = cnt;
				now++;
				point[i] = -1;
				flag = true;
			}
		}
		cnt += now;
	}

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

	return 0;
}

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

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

int main(){
  vector<int> s(101);
  int N;
  vector<int> rel(101,0);
  
  cin>>N;
  for(int i=0;i<N;i++) s[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) s[A-1]+=3;
    else if(C<D) s[B-1]+=3;
    else {
      s[A-1]++;
      s[B-1]++;
    }
  }

  int count=0,b=-1,p;
  while(1){
    int m=0,ans;
    if(count==N) break;
    count++;
    for(int i=0;i<N;i++){
      m=max(m,s[i]);
      if(m==s[i]) ans=i;
    }
    if(b!=s[ans])rel[ans]=count;
    else rel[ans]=rel[p];
    b=s[ans];
    p=ans;
    s[ans]=-1;
  }

  for(int i=0;i<N;i++) cout<<rel[i]<<endl;
  
  return 0;
}

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