Go: package main

import (
        "fmt"
        "bufio"
        "os"
        "strconv"
)

func main() {
        fp := os.Stdin
        scanner := bufio.NewScanner(fp)
        var lst [3]int

        for scanner.Scan() {
                num, _ := strconv.Atoi(scanner.Text())
                if lst[0] < num {
                        lst[2] = lst[1]
                        lst[1] = lst[0]
                        lst[0] = num
                } else if lst[1] < num {
                        lst[2] = lst[1]
                        lst[1] = num
                } else if lst[2] < num {
                        lst[2] = num
                }
        }

        for _, i := range lst {
                fmt.Printf("%d\n", i)
        }
}

C++: #include <iostream>
#include <stdio.h> //printf()

using namespace std;

int main(){
    int i, A[10], tmp, j;

    for (i = 0; i < 10; i++)
        cin >> A[i];

    //bubble sort
    //??????????????????

    j = 3;
    while (j-- > 0) {
        for (i = 0; i < 9; i++) {
            if (A[i] > A[i+1]) {
                tmp = A[i+1];
                A[i+1] = A[i];
                A[i] = tmp;
            }
        }
    }

    printf("%d\n", A[9]);
    printf("%d\n", A[8]);
    printf("%d\n", A[7]);

    return 0;
}

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

int main(){
    int m[10];
    for(int i=0; i<10; i++){
        cin>>m[i];
    }
    
    sort(m , m+10 ,greater<int>());
    
    for(int i=0; i<3; i++){
        cout << m[i] <<endl;
    }
    
    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main() {
  array<int, 10> h;
  for (int& i : h) cin >> i;
  partial_sort(h.begin(), h.begin() + 3, h.end(), greater<int>());
  for (int i = 0; i < 3; ++i) cout << h[i] << endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
vector<LL>v;
int main(){
	REP(i,10){
	    LL a;
	    cin>>a;
	    v.push_back(a);
	}
        sort(v.begin(),v.end());
        reverse(v.begin(),v.end());
	
	REP(i,3){
           cout<<v[i]<<endl;
        }
	return(0);
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <deque>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>

using namespace std;

vector<int> height;

int main() {
	for (int i = 0; i < 10; i++) {
		int input;
		cin >> input;
		height.push_back(input);
	}

	sort(height.begin(), height.end());

	for (int i = 9; i >= 7; i--) {
		cout << height[i] << endl;
	}

	return 0;
}

/*@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@                       @*/
/*@ debug output erased ? @*/
/*@                       @*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@*/

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

int main(){
	short int h[10]={};
	

	for(short int i=1; i<=10;i++){
		cin >> h[i];
		if(!(0<=h<=10000)){
			i--;
			continue;
		}
	}
	cout<<endl;
	sort(h, h+10, greater<int>());
	for(short int i=0;i<3;i++){
		cout << h[i] << endl;
	}
	return 0;
}

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

int main() {
	int a = 0, b = 0, c = 0, h;
	for(int i = 0; i < 9; ++i){
		cin >> h;
		if(a < h){
			c = b;
			b = a;
			a = h;
		}
		else if(b < h){
		    c = b;
		    b = h;
		}
		else if(c < h){
			c = h;
		}
	}
	cout << a << endl << b << endl << c << endl;
	return 0;
}

C++: #include <iostream>
#include <array>

int main(){
    
    int i;
    int max1, max2, max3;
    std::array <int, 10> hill;
    
    max2 = 0;
    max3 = 0;

    for (i = 0; i < 10; ++i) {
        std::cin >> hill.at(i);
        
        if (i == 0) max1 = hill.at(0);
        
        if (max1 < hill.at(i)) { 
            max2 = max1;                    
            max1 = hill.at(i);
        } else if (max2 < hill.at(i)) {
            max3 = max2;
            max2 = hill.at(i);
        } else if (max3 < hill.at(i)) max3 = hill.at(i);
        else {}
    }
    
    std::cout << max1 << std::endl << max2 << std::endl << max3 << std::endl;
    
    return 0;
}

C++: #include<iostream>
int main(void){
    int h;
    int t[3] = {0, 0, 0};
    for(int i = 0; i < 10; i++){
        std::cin >> h;
        for(int i = 0; i < 3; i++){
            if(t[i] <= h){
                switch(i){
                    case 0:
                        t[i+2] = t[i+1];
                        t[i+1] = t[i];
                        t[i] = h;
                        break;
                    case 1:
                        t[i+1] = t[i];
                        t[i] = h;
                        break;
                }
                break;
            }
        }
    }
    for(int i = 0; i < 3; i++){
        std::cout << t[i] << std::endl;
    }
    return 0;
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  while (true) {}
}

C++: #include<iostream>

using namespace std;

int main()
{
	int high[10] = { };
	int first = 0, second = 0, third = 0;
	
	for(int i = 0; i < 10; i++){
		cin >> high[i];
		
		if(first < high[i])
			first = high[i];
		else if(second < high[i])
			second = high[i];
		else if(third < high[i])
			third = high[i];
	}
	
	cout << first << endl << second << endl << third << endl;
	
	
	return 0;
}

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

int main() {
    clock_t cTimeStart, cTimeEnd;
    cTimeStart = clock();           // 現在時刻
    int H[10];
    for(int i=0;i<10;++i){
    	cin>>H[i];
    }
    sort(H,H+10);
    for(int i=0;i<3;++i){
    	    cout<<H[9-i]<<endl;
    }

    cTimeEnd = clock();           // 現在時刻
//    cout<< "処理時間:" <<(cTimeEnd - cTimeStart)/1000 << "[ms]" << endl;

	return 0;
}

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

int main(){

	int mountain[10];

	for(int i=0; i<10; i++){
		cin >> mountain [i];
	}
	sort(mountain,mountain+10);
	
	cout << mountain [9] << endl << mountain[8] << endl << mountain[7];
	
    return 0;
}

C++: 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include<stdio.h>
  
int main(){
    int i,j,t,data[10];
      
    for(i=0;i<10;i++)
    {
        scanf("%d",&data[i]);
    }
      
    for(i=0;i<9;i++)
    {
        for(j=0;j<9-i;j++)
        {
            if(data[j]<data[j+1])
            {
                t=data[j];
                data[j]=data[j+1];
                data[j+1]=t;
            }
        }
    }
    for(i=0;i<3;i++)
    {
        printf("%d\n",data[i]);
    }
  
    return 0;