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>
#define S second
#define F first
using namespace std;
typedef pair<int,int> P;
typedef pair<int, P > PP;
main(){
  PP team[1000];
  int n;
  int a,b,c,d;
  cin>>n;
  int kekka=0;
  for(int i=0;i<n-1;i++){
    team[i].S.F=i;
    team[i].F=0;
    kekka+=(i+1);
  }
  team[n-1].F=0;
  team[n-1].S.F=n;
  for(int i=0;i<kekka;i++){
    cin>>a>>b>>c>>d;
    a--;
    b--;
    if(c>d){
      team[a].F+=3;
    }
    else if(c<d){
      team[b].F+=3;
    }
    else{
      team[a].F++;
      team[b].F++;
    }
  }
  sort(team,team+n,greater<PP>());
  int rank=1;
  int up=1;
  team[0].S.S=1;
  swap(team[0].S.F,team[0].F);
  for(int i=1;i<n;i++){
    if(team[i-1].S.F>team[i].F){
      rank+=up;
      up=1;
    }
    else{
      up++;
    }
    team[i].S.S=rank;
    swap(team[i].F,team[i].S.F);
  }
  sort(team,team+n);
  for(int i=0;i<n;i++){
    cout<<team[i].S.S<<endl;
  }
}

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

int n;
int id[102], score[102], rank[102];

int main(){
  while(cin >> n){
    //ツ催?渉可づ債全ツチツーツδ?づ個スツコツアツつェ0ツづ按づ個づ? 0ツづ?渉可甘コツ可サツつオツづ?つィツつォツづ慊つキ
    memset(score, 0, sizeof(score));

    for(int i = 0; i < n * (n - 1) / 2; i++){
      int a, b, c, d;
      cin >> a >> b >> c >> d;

      //ツイツδ督デツッツクツスツつェ1ツつゥツづァツづ按づ個づ? 0ツづ可債?づュツつケツづ慊つキ
      a--;
      b--;

      //Aツつェツ渉淞づ?
      if(c > d){
        score[a] += 3;
      }
      //Aツづ?ツづ債暗クツつォツ閉ェツつッ
      else if(c == d){
        score[a]++;
        score[b]++;
      }
      //Bツつェツ渉淞づ?
      else{
        score[b] += 3;
      }
    }

    //ツソツーツトツつオツつスツ古」ツづ可づ?づ個チツーツδ?つェツ可スツ氾板姪堋づ個チツーツδ?つセツづ?つスツつゥツづュツつゥツづァツづ按つュツづ按づ?づ?つオツづ慊つ、ツづ個づ?
    //ツスツコツアツづーツソツーツトツつキツづゥツづ?つォツづ? ツチツーツδ?づ個渉?氾板づ?暗ェツ渉渉づ可ソツーツトツつオツづ慊つキ
    for(int i = 0; i < n; i++){
      id[i] = i;
    }

    //ツソツーツトツ渉按猟敖づ?つキ
    for(int i = 0; i < n; i++){
      for(int j = i + 1; j < n; j++){
        //ツ渉?氾板つェツ逆ツ転ツつオツづ?つ「ツづゥツ湘ェツ債?づ? ツ禿シツづェツ妥鳴つヲ
        if(score[i] < score[j]){
          swap(score[i], score[j]);
          swap(id[i], id[j]);
        }
      }
    }

    //ツ出ツ療債づ個配ツ療アツづ可渉?暗環づーツ渉堕つォツつアツづアツづ?つ「ツつォツづ慊つキ
    for(int i = 0; i < n; i++){
      //ツ暗ェツづつ湘」ツづ個チツーツδ?づ?スツコツアツつェツ督ッツつカツづ按づァ, ツ暗ェツづつ湘」ツづ個チツーツδ?づ?督ッツつカツ渉?暗環づーツ渉堕つォツつアツづ敖づ慊つキ
      if(0 < i && score[i] == score[i - 1]){
        rank[id[i]] = rank[id[i - 1]];
      }
      //ツ督ッツつカツスツコツアツづ?づ按つ「ツづ按づァ, i+1ツつェツ渉?暗環づ可づ按づィツづ慊つキ(iツづ債スツコツアツづ個渉?づ?δ仰ーツプツづーツ嘉アツつオツづ?つ「ツづゥツつスツづ?
      else{
        rank[id[i]] = i + 1;
      }
    }

    //ツ出ツ療債つオツづ慊つオツづ・ツつ、
    for(int i = 0; i < n; i++){
      cout << rank[i] << endl;
    }
  }
}

C++: #include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())

int check(int n, vector<int> &v, int N){
  int res = 1;
  REP(i, N) if(i != n && v[i] > v[n]) ++res;
  return res;
}

int main() {
  int N; cin >>N;
  vector<int> v(N, 0);
  REP(i, N * (N - 1) / 2){
    int a, b, c, d; cin >>a >>b >>c >>d;
    if(c > d) v[a - 1] += 3;
    else if(c < d) v[b - 1] += 3;
    else { ++v[a - 1]; ++v[b - 1]; }
  }
  REP(i, N) cout <<check(i, v, N) <<endl;
  return 0;
}

C++: #include<iostream>
#include<map>
#include<algorithm>
using namespace std;
typedef pair<int,int> P;
main(){
  pair<int,P> team[101]; //first=number second=point&rank
  int n;
  int right,left,scorer,scorel;
  int count=0;
  cin>>n;
  for(int i=1;i<=n;i++){
    count=count+i-1;
    team[i].first=i;
    team[i].second.first=0;
  } 
  for(int i=0;i<count;i++){
    cin>>right>>left>>scorer>>scorel;
    if(scorer==scorel){
      team[right].second.first=team[right].second.first+1;
      team[left].second.first=team[left].second.first+1;
    }
    else if(scorer>scorel){
      team[right].second.first=team[right].second.first+3;
    }
    else{
      team[left].second.first=team[left].second.first+3;
    }
  }
  for(int i=1;i<=n;i++){
    for(int j=n;j>1;j--){
      if(team[j].second.first>team[j-1].second.first){
	pair<int,P> a;
	a=team[j];
	team[j]=team[j-1];
	team[j-1]=a;
      }
    }
  }
  int now=1;
  for(int i=1;i<=n;i++){
    team[i].second.second=now;
    if(i!=n){
      if(team[i].second.first!=team[i+1].second.first){
	now=now+1;
      }
    }
  }
  for(int i=1;i<=n;i++){
    for(int j=n;j>1;j--){
      if(team[j].first<team[j-1].first){
	pair<int,P> a;
	a=team[j];
	team[j]=team[j-1];
	team[j-1]=a;
      }
    }
  }
  for(int i=1;i<=n;i++){
    cout<<team[i].second.second<<endl;
  }
}

C++: #include<stdio.h>
#include<math.h>
#include<algorithm>
#include<cctype>
#include<string.h>
#include <stdlib.h>

#define PI 3.1415926
void swap(int* x, int* y) {
	int a = *x;
	int b = *y;
	*x = b;
	*y = a;
}
int factorial(int n);
int sum(int n, int*);
int ave(int n, int*);
int min(int n, int*), min(int n, int m);
int max(int n, int*), max(int n, int m);

int main() {
	int N, X[200],a,b,c,d;
	scanf("%d", &N);
	for (int i = 1; i <= N*(N - 1) / 2; i++) {
		scanf("%d %d %d %d", &a, &b, &c, &d);
		if (c = d) {
			X[a]++;
			X[b]++;
		}
		else if (c < d) {
			X[b] += 3;
		}
		else {
			X[a] += 3;
		}
	}
	for (int i = 1; i <= N; i++) {
		printf("%d\n", X[i]);
	}
	return 0;
}

int factorial(int n) {
	if (n > 0) {
		return n * factorial(n - 1);
	}
	else {
		return 1;
	}
}
int sum(int n, int *all) {
	int total = 0;
	for (int i = 0; i < n; ++i) {
		total += all[i];
	}
	return total;
}
int ave(int n, int *all) {
	int total = 0;
	for (int i = 0; i<n; ++i) {
		total += all[i];
	}
	return total / n;
}
int min(int n, int *all) {

	int min = all[0];
	for (int i = 1; i < n; ++i) {
		if (all[0] > all[i]) {
			min = all[i];
		}
	}
	return min;
}
int max(int n, int *all) {
	int max = all[0];
	for (int i = 1; i<n; ++i) {
		if (all[0]<all[i]) {
			max = all[i];
		}
	}
	return max;
}
int max(int n, int m) {
	if (n >= m) {
		return n;
	}
	else {
		return m;
	}
}
int min(int n, int m) {
	if (n >= m) {
		return m;
	}
	else {
		return n;
	}
}