Go: package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	counter := 0
	var mountain []int
	for scanner.Scan() {
		i, err := strconv.Atoi(scanner.Text())
		if err != nil {
			break
		}
		mountain = append(mountain, i)
		counter++
		if counter == 10 {
			break
		}

	}
	sort.Ints(mountain)
	fmt.Println(mountain[9])
	fmt.Println(mountain[8])
	fmt.Println(mountain[7])
}

C++: #include<bits/stdc++.h>
using namespace std;

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

  for(int i = 0; i < 3; i++){
    int *ans;
    ans = max_element(mt, mt+10);
    cout << *ans << endl;
    *(mt+(ans-mt)) = 0;
  }
}

C++: #include<iostream>
using namespace std;
int main(void){
	int T,t3,t2,t1;
	for(int i=0;i<10;i++){
		cin>>T;
		if(T>=t1){
			t1=T;
			t2=t1;
			t3=t2;
		}
		else if(T>=t2){
			t2=T;
			t3=t2;
		}
		else if(T>=t3){
			t3=T;
		}
	}
	cout<<t1<<endl<<t2<<endl<<t3;
	return 0;
}

C++: #include <stdio.h>

//１０個のデータを入力し、大きい順で３つのデータを取り出すプログラム

int main(void)
{
	int i, j;		//繰り返し変数
	int h[10];		//データ格納スペース
	int n = 0;			//一時変数
	int rank[3];	//順位付けしたデータを格納

	for (i = 0; i < 10; i++){
		scanf("%d", &h[i]);
	}
	for (j = 0; j < 3; j++){
		for (i = 0; i < 10; i++){
			if (h[n] < h[i]){
				n = i;
			}
		}
		rank[j] = h[n];
		h[n] = -1;
		n = 0;
	}

	printf("%d\n", rank[0]);
	printf("%d\n", rank[1]);
	printf("%d\n", rank[2]);

	return (0);
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
using namespace std;



int main()
{
	//freopen("in.txt","r",stdin);
	//freopen("out.txt","w",stdout);
	
	int i,a[10];
	for(i=0;i<10;i++)
		scanf(" %d",&a[i]);
	sort(a,a+10);
	printf("%d\n%d\n%d\n",a[9],a[8],a[7]);
	
	return 0;
}

C++: #include<iostream>
#include <cstdio>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

////Nayeem Shahriar Joy,Applied Physics &Electronic Engineering,University of Rajshahi.

int main()

{
   vector<int>l;
   int a;
   for(int i=0;i<10;i++)

   {
       cin>>a;
       l.push_back(a);
   }
   sort(l.begin(),l.end());
   cout<<l[9]<<endl;
   cout<<l[8]<<endl;
   cout<<l[7]<<endl;
   return 0;
}

C++: #include<iostream>
using namespace std;
int h[3];
int main()
{
	for(int i=1; i<=10; i++)
	{
		int tmp;
		cin>>tmp;
		for(int j=0; j<3; j++)
		{
			if(tmp>h[j])
			{
				int temp = h[i];
				h[j]=tmp;
				tmp = temp;
			}
		}
	}
	for(int i=0; i<3; i++)
			cout<<h[i]<<endl;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int a[10];
	for(int i=0;i<10;i++){
		cin>>a[i];
	}
	sort(a,a+10);
	for(int i=9;i>6;i++){
		cout<<a[i]<<endl;
	}
	return 0;
}

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

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

  sort(a, a+10);

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

  return 0;
}

C++: #include <stdio.h>
#include <iostream>

using namespace std;

int main(){
	//変数宣言
	int height[10],	//高さの配列
		pos,		//最大値消去用
		max[3];		//最大値格納
	//入力
	for(int i=0;i<10;i++)
		cin >> height[i];

	//最大値を出す
	for(int i=0;i<3;i++){
		int tmp = 0;
		//最大値を出す & posに場所記録
		for(int n=0;n<10;n++){
			if(tmp<height[n]){
				tmp = height[n];
				pos = n;
			}
		}
			//最大値を記録
			max[i] = tmp;
			//最大値を消す
			height[pos] = 0;
	}

	//表示
	for(int i=0;i<3;i++)
		cout << max[i] << "\n";
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

int main(){

  vector<int> mt(10);

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

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

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

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

int main(){
  int n[10];

  for(int i=0; i<10; i++) {
    cin >> n[i];
  }
  cout << "\n";

  sort(n, n+10);

  for(int j=0; j<3; j++) {
    cout << n[9-j] << "\n";
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int hight[10];
	for(int i=0; i<10; i++){
		cin >>hight[i];
	}
	for(int i=0; i<10; i++){
		for(int l=0; l<9; l++){
			if(hight[l]<hight[l+1]){
				int c = hight[l];
				hight[l] = hight[l+1];
				hight[l+1] = c;
			}
		}
	}
	cout <<hight[0]<<endl<<hight[1]<<endl<<hight[2]<<endl;
	return 0;
}

C++: 
#include <cstdio>
#include <algorithm>

using namespace std;

int m[10];

int main()
{
    for(int i = 0; i < 10; ++i) scanf("%d", &m[i]);

    sort(m, m + 10);
    
    printf("%d\n%d\n%d\n", m[9], m[8], m[7]);
}

C++: #include<stdio.h>

int main(){
	int a1 = 0, a2 = 0, a3 = 0;

	int x;
	for(int i = 0; i < 10; i++){
		scanf("%d\n", &x);
		if(x > a3){
			a3 = x;
		}
		if(x > a2){
			a3 = a2;
			a2 = x;
		}
		if(x > a1){
			a3 = a2;
			a2 = a1;
			a1 = x;
		}
	}

	printf("%d\n%d\n%d\n", a1, a2, a3);

	return 0;
}

C++: #include <iostream>
#define データ数 10

using namespace std;

int main(){

	int hight[10];
	int num;
	int baffer;
	int flag=1;

	for(num=0;num!=データ数;num++)
	{
		cin>>hight[num];
	};

	for(num=0;num!=データ数;num++)
	{
		if(hight[num]<hight[(num+1)]){

		baffer=hight[(num+1)];

		hight[(num+1)] = hight[num];
		
		hight[num] = baffer;
		
		flag++;}
		
		if(num==(データ数-2)){
			if(flag==0){break;}
			else{num=-1;flag=0;};

		};
	};

	cout<<hight[0]<<endl;
	cout<<hight[1]<<endl;
	cout<<hight[2]<<endl;

return 0;
}

C++: #include <iostream>
using namespace std;
int mt[10];
int main()
{
    for (int i = 0; i < 10; i++)
        cin >> mt[i];
    for (int t = 1; t <= 3; t++)
    {
        int maxv = -1, mark = 0;
        for (int i = 0; i < 10; i++)
        {
            if (mt[i] > maxv)
            {
                maxv = mt[i];
                mark = i;
            }
        }
        cout << maxv << endl;
        mt[mark] = -100;
        maxv = -1;
        mark = 0;
    }
    return 0;
}

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

int main()
{
	int h;
	int mh[3] = {0};

	for(i=0;i<10;i++){
		cin<<h;
		if(mh[0] < h) mh[0] = h;
		else if(mh[1] < h) mh[1] = h;
		else if(mh[2] < h) mh[2] = h;

	}
        
        for(i=0;i<3;i++)	cout<<mh[i]<<endl;

	return 0;
}

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

void swap(int& x, int& y){
    int t = x;
    x = y;
    y = t;
}
int main(){
    int height[10];
    //入力
    cout << "Write heights of 10 mountain\n";
    for(int i = 0;i < 10;i++){
        cin >> height[i];
        if(height[i] < 0 || height[i] > 10000){
            cout << "incorrect height of mountain\n";
            i--;
        }
    }
    //ソート
    cout << "sorting　";
    for(int i = 0;i < 10;i++){
        for(int j = i;j > 0;j--){
            if(height[j] > height[j-1]){
                swap(height[j], height[j-1]);
            }
        }
    }
    //出力
    cout << "result\n";
    for(int i = 0;i < 3;i++){
        cout << height[i] << "\n";
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
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;
	cout << A[8]<<endl;
	cout << A[7];
    return 0;
}

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

class top3
{
private:
	int idx;
	int x;
	int y;
	int hill[10];
	int top[3];
public:
	void empty(){
		idx=0;
		y=0;
		x=10;
	}
	void push(int v){
		hill[idx++]=v;
	}
	int pop(){
		int i;
		top[y]=hill[i];
		for(i=0;i<x;i++){
			
			if(hill[i]>top[y]) {top[y]=hill[i];
		}
		x--;
		return top[y++];
	
	};
	
};
int main(){

	top3 a;
	int n,v;
	cin>>n;
	a.empty();
	for(int i=0;i<n;i++){
		cin>>v;
		a.push(v);
	}
	for(int i=0;i<n;i++){
		cout<<a.pop()<<endl;
	}
	return 0;
}

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

using namespace std;

int main(){
	int mt[10];
	for(int i=0;i<10;i++){
		cin >> mt[i];
	}
	for(int i=0;i<3;i++){
		int *maxmt = &mt[0];//mtと同じ。ポインタにすることでアドレスと値を同時に見れる
		for(int j=0;j<10;j++){
			if(*maxmt < mt[j]){
				maxmt = &mt[j];
			}
		}
		cout << *maxmt << endl;
		*maxmt = 0;
	}
	return 0;
}