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 <math.h>
#include <string>
#include <stdio.h>
#include <string.h>
#include <algorithm>

using namespace std;

int main(void)
{
    int n, a[100],rank[100], b[100], c[100],d[100],k[100],win[100],lose[100],p[100],pp[100];
    cin >> n;

    for (int i = 0; i < n * (n - 1) / 2; i++)
    {
        cin >> a[i] >> b[i] >> c[i] >> d[i];
        if (c[i] < d[i])
        {
            win[i] = b[i];
            lose[i] = a[i];
            p[i] = 0;
            pp[i] = 0;
        }
        else if (c[i] > d[i])
        {
            win[i] = a[i];
            lose[i] = b[i];
            p[i] = 0;
            pp[i] = 0;
        }
        else if (c[i] == d[i])
        {
            win[i] = 0;
            lose[i] = 0;
            p[i] = a[i];
            pp[i] = b[i];
        }
    }

    for (int i = 0; i < n * (n - 1) / 2; i++)
    {
        for (int j = 1; j < n + 1; j++)
        {
            if (win[i] == j)
            {
                k[j] += 3;
            }
            if (lose[i] == j)
            {
                k[j] += 0;
            }
            if (p[i] == j || pp[i] == j)
            {
                k[j] += 1;
            }            

        }
    }

    for (int j = 1; j < n + 1; j++)
    {
        rank[j] = 1;
        for (int l = 1; l < n + 1; l++)
        {
            if (k[j] <= k[l])
            {
                rank[j] += 1;
            }
        }
    }
    for (int j = 1; j < n + 1; j++)
    {
        cout << rank[j] << endl;
    }
}

C++: #include<cstdio>
#include <iostream>
#include <string>
#include<algorithm>
#include <map>
#pragma warning(disable:4786)  // VisualC++6.0の警告対策



using namespace std;

#define ll long long
#define SINT(n) scanf("%d",&n);
#define SINT2(n,m) scanf("%d %d",&n,&m);
#define SINT3(n,m,o) scanf("%d %d %d",&n,&m,&o);
#define SINT4(n,m,o,p) scanf("%d %d %d %d",&n,&m,&o,&p);
#define SLL(n) scanf("%lld",&n);
#define SST(s) scanf("%s",&s);

#define PINT(n) printf("%d",(int)(n));
#define PINT2(n,m) printf("%d %d",(int)(n),(int)(m));
#define PLL(n) printf("%lld",(long long)(n));
#define PST(s) printf("%s",(s));
#define PCH(s) printf("%c",(s));

#define PINTN(n) printf("%d\n",(int)(n));
#define PINT2N(n,m) printf("%d %d\n",(int)(n),(int)(m));
#define PLLN(n) printf("%lld\n",(long long)(n));
#define PSTN(s) printf("%s\n",(s));
#define PCHN(s) printf("%c\n",(s));

#define PSP() printf(" ");
#define PN() printf("\n");


#define dlp(i) while(i-->0)
#define ulp(i) for(ll _hoge_counter_hoge_=i,i=0;i<_hoge_counter_hoge_;i++)

#define lp(i) for(ll _hoge_counter_hoge_=i;_hoge_counter_hoge_--;)
#define lpp(i,to) for(i=0;i<to;i++)
#define lpft(i,from,to) for(i=from;i<to;i++)

#define lengthof(x)

//#define FILL(a,v)(a, a + (sizeof (a) / sizeof *(a)), v);
#define FILL_ZERO(a) memset(a,0,sizeof(a));
#define FILL_ONE(a) memset(a,-1,sizeof(a));

map<ll, map<ll, short> > memo[50][50][4];

char Map[60][60];

int main(){

	int N;
	int i,j,k;
	int a,b,c,d;
	int t[100];

	FILL_ZERO(t);

	SINT(N);

	
	lpp(i,N*(N-1)/2){
		SINT4(a,b,c,d);
		if(c>d){
			t[a-1]+=3;
		}
		if(c<d){
			t[b-1]+=3;
		}
		if(c==d){
			t[a-1]++;
			t[b-1]++;
		}
	}

	lpp(i,N){
		a=1;
		lpp(j,N){
			if(t[j]>t[i]) a++;
		}
		PINTN(a);
	}
	
	return 0;
}

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

int n;
map<int, int> mp;

int main()
{
    cin >> n;
    vector<pair<int, int>> v(n);
    vector<int> a(n);
    for (int i = 0; i < n; i++)
    {
        v[i] = make_pair(0, i + 1);
    }
    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++, v[b].first++;
        else if (c < d)
            v[b].first += 3;
        else
            v[a].first += 3;
    }
    sort(v.rbegin(), v.rend());
    for (int i = 0; i < v.size(); i++)
    {
        if (mp[v[i].first] == 0)
        {
            mp[v[i].first] = i + 1;
            a[v[i].second - 1] = i + 1;
        }
        else
            a[v[i].second - 1] = mp[v[i].first];
    }
    for (int i = 0; i < n; i++)
    {
        cout << a[i] << endl;
    }
}

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

C++: #include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int main(void)
{
	int i,j,n,m,n1,a,b,c,d,x[100],t[100];
	cin>>n;
	for(i=0;i<n;i++){
		x[i]=0;
		t[i]=1;
	}
	n1=n*(n-1)/2;
	for(i=0;i<n1;i++){
		cin>>a>>b>>c>>d;
		if(c>d) x[a-1]=x[a-1]+3;
		if(c<d) x[b-1]=x[b-1]+3;
		if(c==d){
			x[a-1]=x[a-1]+1;
			x[b-1]=x[b-1]+1;
		}
//		cout<<'1'<<'2'<<'3'<<'4'<<endl;
//		cout<<x[0]<<x[1]<<x[2]<<x[3]<<endl;
	}
/*	for(i=0;i<n;i++) cout<<x[i];
	cout<<endl;*/
	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			if(x[i]<x[j]){
				t[i]=t[i]+1;
			}
		}
	}
	for(i=0;i<n;i++){
		cout<<t[i]<<endl;
	}
	return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<functional>
using namespace std;
int main(void)
{
	int n,i,j,gou;
	int a[101],b[101],c[101],d[101],t[101],jun[101];
	scanf("%d",&n);
	gou=n*(n-1)/2;
	for(i=0;i<101;i++){
		t[i]=0;
		jun[i]=1;
	}
	for(i=1;i<=gou;i++){
		scanf("%d %d %d %d",&a[i],&b[i],&c[i],&d[i]);
		if(c[i]>d[i]){
			t[a[i]]+=3;
		}
		else if(c[i]<d[i]){
			t[b[i]]+=3;
		}
		else{
			t[a[i]]+=1;
			t[b[i]]+=1;
		}
	}
	for(i=1;i<n;i++){
		for(j=1+i;j<=n;j++){
			if(t[i]==t[j]){}
			else if(t[i]>t[j]){
				jun[j]+=1;
			}
			else if(t[i]<t[j]){
				jun[i]+=1;
			}
		}
	}
	for(i=1;i<=n;i++){
		printf("%d\n",jun[i]);
	}
	return 0;
}