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 <algorithm>
#include <iostream>
#include <list>
using namespace std;

int main(int argc, char const *argv[]) {
  int input_num = 10;

  list<int> ls;

  int height = 0;
  for (size_t i = 0; i < input_num; i++) {
    cin >> height;
    ls.push_back(height);
  }

  ls.sort(std::greater<int>());

  auto it = ls.begin();
  for (int i = 0; i < 3; i++) {
    cout << *it << endl;
    it++;
  }

  return 0;
}

C++: #include <iostream>
#define N 10

using namespace std;

void swap(int& a, int& b){
	int tmp = a;
	a = b;
	b = tmp;
}

void bubble_sort(int mountain[N]){
	for (int i=0; i<N; ++i){
		for (int j=0; j<(N-i); ++j){
			if (mountain[j] < mountain[j+1]){
				swap(mountain[j], mountain[j+1]);
			}
		}
	}
}

int main(void){
	int mountain[N];
	for (int i=0; i<N; ++i){
		int tmp;
		//do{
			cin >> tmp;
			/*if ((tmp<0) || (10000 < tmp)){
				return -1;
			}*/
		//}while ((tmp<0) || (10000 < tmp));
		mountain[i] = tmp;
	}
	bubble_sort(mountain);
	//cout << "output" << endl;
	for (int i=0; i<3; ++i){
		cout << mountain[i] << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
#include <cstdio>
#include <complex>
#include <cstring>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define pb(a) push_back(a)
int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

int main(void){
  int a[10];
  rep(i,10)cin>>a[i];
  sort(a,a+10,greater<int>());
  rep(i,3)cout<<a[i]<<endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
int a[11];
int main(){
	for(int i=1;i<=10;i++){
		scanf("%d",&a[i]);
	}
	sort(a+1,a+11);
	printf("%d\n%d\n%d",a[10],a[9],a[8]);
}

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

int main(){
	int m,max=0,cen=-1,min=-2;
	cin >> m;
	max=m;
	cen=m;
	min=m;
	for(int i=1;i<10;i++){
		cin >> m;
		if(max<m){
			min=cen;
			cen=max;
			max=m;
		}
		else if(cen<=m){
			min=cen;
			cen=m;
		}
		else if(min<=m) min=m;
	}
	cout << max << endl;
	cout << cen << endl;
	cout << min << endl;

		return 0;
}

C++: #include<stdio.h>

void swap(int *x,int *y){
        int temp;

        temp=*x;
        *x=*y;
        *y=temp;

}

int main(void){
        int i,j,k;
        int height[10];

        i=0;

        while(scanf("%d",&height[i])==1){
                i++;
                if(i==10) break;
        }


        for(j=0;j<10;j++){
                if(height[j]<0 || height[j]>10000){
                        height[j]=0;
                }
        }



        for(i=0;i<10;i++){
                for(j=0;j<10;j++){
                        if(height[i]<height[j]){
                        swap(&height[i],&height[j]);
                        }
                }
        }       /*sort*/

        printf("\n");

        k=9;


        while(1){
                printf("%d\n",height[k]);
                k--;
                if(k==6) break;
        }




        return 0;
}

C++: #include <iostream>
#define N 10

using namespace std;

void swap(int& a, int& b){
	int tmp;
	if (a > b){
		tmp = a;
		a = b;
		b = tmp;
	}
}

void bubble(int mountain[N]){
	for (int i=0; i<(N-1); ++i){
		for (int j=i; j<(N-1); ++j){
			swap(mountain[j], mountain[j+1]);
		}
	}
}


int main(void){
	int mountain[N] = {0, };
	for (int i=0; i<N; ++i){
		cin >> mountain[i];
		if ((mountain[i] < 0) || (mountain[i] > 10000)){
			//cout << "Range out!" << endl;
			return -1;
		}
	}
	bubble(mountain);
	//cout << "output!" << endl;
	for (int i=9; i>=7; --i){
		cout << mountain[i] << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int n[10];
  for(int i=0;i<10;i++){
    cin>>n[i];
  }
  sort(n,n+10);//昇順ソート
  for(int i=9;i>=7;i--){
    cout<<n[i]<<endl;
  }
}

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

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

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

int main()
{
	int Hill[10];

	for (int i = 0; i < 10; i++){
		cin >> Hill[i];
	}

	sort(Hill, Hill + 10);

	cout << Hill[9] << endl << Hill[8] << endl << Hill[7] << endl;

	return (0);
}

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

int main()
{
	multiset<int> s;
	for(int i=0;i<10;i++){
		int in;
		cin >> in;
		s.insert(in);
	}
	
	multiset<int>::iterator it = s.end();
	--it;
	cout << endl;
	for(int i=0;i<3;i++){
		cout << *it << endl;
		--it;
	}
	return 0;
}

C++: #include <stdio.h>

int main(void)
{
	int i,f=0,s=0,t=0,h[10];
	for(i=0;i<10;i++){
		scanf("%d",&h[i]);
	}
	for(i=0;i<10;i++){
		if(f<h[i]){
			f=h[i];
		}
	}
	for(i=0;i<10;i++){
		if(s<h[i]&&f>=h[i]){
			s=h[i];
		}
	}
	for(i=0;i<10;i++){
		if(t<h[i]&&s>=h[i]){
			t=h[i];
		}
	}
	printf("%d\n%d\n%d\n",f,s,t);
	return 0;
}

C++: #include <iostream>
using namespace std;
  
int a[3],n;
  
int main(){
  a[0] = 0;
  a[1] = 0;
  a[2] = 0;
  for(int i = 0; i < 10; i++){
    cin >> n;
    if(a[2] > n){
    }else{
      if(a[1] > n){
        a[2] = n;
      }else{
        if(a[0] > n){
          a[2] = a[1];
          a[1] = n;
        }else{
          a[2] = a[1];
          a[1] = a[0];
          a[0] = n;
        }
      }
    }
  }
  cout << a[0] << endl << a[1] << endl << a[2] << endl;
}

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

int main() {
  array<int,10> a;
  for(int &i: a) cin >> i;
  sort(a.begin(),a.end(),greater<int>());
  for(int i: {0,1,2}) cout << a[i] << endl;
  return 0;
}

C++: #include <iostream>
using namespace std;
int main()
{
int big1;
cin >> big1;
int big2=0;
int big3=0;
int input;
for(int i=2;i<=10;i++)
{cin >> input;
if(input>=big1 && input>=big2 && input>=big3)
{big3=big2;
big2=big1;
big1=input;}
else if(input>=big2 && input>=big3)
{big3=big2;
big2=input;}
else if(input>=big3)
{big3=input;}
}
cout << big1 << endl << big2 << endl << big3 << endl;
return 0;
}

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

int main(){

	int a[11],max1,max2,max3;

	for (int i=1; i<11; i++){
		while (true){ 
		cout << "山の高さ" << i << "（整数）" ;			
		cin >> a[i];
		if ((cin.good() == 1) && (a[i] >= 0) && (a[i] <= 10000)) {
			break;
		}
		}	
	}

	max1 = a[1];

	for (i=2; i<11; i++){
		if (max1 < a[i]){
			swap (max1,a[i]);
		}
	}
	max2 = a[2];

	for (i=3; i<11; i++){
		if (max2 < a[i]){
			swap (max2,a[i]);
		}
	}
	max3 = a[3];

	for (i=4; i<11; i++){
		if (max3 < a[i]){
			swap (max3,a[i]);
		}
	}


		cout << max1 << endl;
		cout << max2 << endl;
		cout << max3 << endl;
		

return 0;
	}

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

int main(){
	
	int mt[10];
	int i, s, t, tmp, j;
	
	for(i=0; i<10; i++){
		cin >> mt[i];
	}
	
	for(s=0; s<9; s++){
		for(t=s+1; t<10; t++){
			if(mt[t] > mt[s]){
				tmp = mt[t];
				mt[t] = mt[s];
				mt[s] = tmp;
			}
		}
	}
	
	for(j=0; j < 3; j++){
		cout << mt[j] << endl;
	}
	

	return 0;
	
}