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>
using namespace std;


int main(void){

	int a[11],i,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 yama[10];
	// int first = 0;
	// int second = 0;
	// int third = 0;

	for(int i=0; i<10; i++){
		cin >> yama[i];
	// 	if(yama[i] > first){
	// 		third = second;
	// 		second = first;
	// 		first = yama[i];
	// 	}
	// 	if(yama[i] > second && yama[i] < first)second = yama[i];
	// 	if(yama[i] > third && yama[i] < second)third = yama[i];
	}

	// cout << first << endl;
	// cout << second << endl;
	// cout << third << endl;
	
	int one,two;//??????????????¨
	for(int k=0; k<10; k++){
		for(int i=0; i<9; i++){
			if(yama[i] > yama[i+1]){
				one = yama[i];
				two = yama[i+1];
				yama[i] = two;
				yama[i+1] = one;

				// for(int j=0; j<10; j++){
				// cout << yama[j] << " ";
				// }
				// cout << endl;
			}
		}
	}

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

	return 0;
}

C++: //http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0001

#include <iostream>
#include <algorithm>
using namespace std;
int main() {
	int d[10] = { 0 };
	for (int i = 0; i < 10;i++) cin >> d[i];
	sort(d, d + 10);
	reverse(d, d + 10);
	cout << d[0] << endl << d[1] << endl << d[2] << endl;
}

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

int main(){

  int a[10],i=1;
  cin << i;
  while(cin >> a[i]){
    i++
  }
  sort(a,a+i);
  cout << a[i-1] << endl;
  cout << a[n-2] << endl;
  cout << a[i-3] << endl;

  return 0;
}

C++: #include<stdio.h>

int main(void)
{
	int high[10]={1819,2003,876,2840,1723,1673,3776,2848,1592,922};
	int x,max,time;


	for(time=1;time<=3;time++)
	{
		max=0;

		for(x=0;x<10;x++)
		{
			if(max<high[x])
			{
				max=high[x];
			}
		}
		for(x=0;x<10;x++)
		{
			if(max==high[x])
			{
				printf("%d\n",high[x]);
				high[x]=0;
			}
		}
	}

	return 0;
}

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

int main(){
	int mountain[10]={}, first=0, second=0, third=0;

	for(int i=0; i<10; i++){
		cin >> mountain[i];
		if(first <= mountain[i]){
			first = mountain[i];	
		}
		else if(mountain[i]<=first && mountain[i]>=second){
			second = mountain[i];
		}
		else if(mountain[i]<=second && mountain[i]>=third){
			third = mountain[i];
		}
	}
	cout << first << "\n" << second << "\n" << third << endl;

	return 0;
}

C++: num = []
i=0
while i < 10
      num[i] = gets.to_i
      i+=1
end

num.sort!{|a, b| (-1) * (a <=> b)}

puts "result"
for n in 0..2
    puts "#{num[n]}"
end

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

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

C++: #include<iostream>
#include<string>
#include<vector>

using namespace std;

int main(){

	vector<int> mountains;
	
	for(int i= 0 ; i<10 ; i++){
		int a;
		cin>>a;
		mountains.push_back(a);
	}

	for(int i=0 ; i<mountains.size()-1 ; i++){
		for(int j=0 ; j<mountains.size()-1 ; j++){
			if(mountains[j] < mountaians[j+1]){
				int tmp;
				
				tmp = mountains[j];
				mountains[j] = mountains[j+1];
				mountains[j+1] = tmp;
			}
		}
	}

	for(int i ; i<3 ; i++){
		cout<<mountains[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<cstdio>

int main()
{
    int i=0,j=0,a[10]={0},temp;
    for(i=0;i<=9;i++) scanf("%d",&a[i]);
    for(i=j;i<=9;i++)
    {
       for(j=0;j<=2;j++)
            if(a[i]>a[j])
            {
                temp=a[i];
                a[i]=a[j];
                a[j]=temp;
            }
    }
    printf("%d\n%d\n%d\n",a[0],a[1],a[2]);
    return 0;

}

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

int h[10];
int main(){
    for(int i=0;i<10;i++)scanf("%d",&h[i]);
    sort(h,h+10);reverse(h,h+10);
    for(int i=0;i<3;i++)printf("%d\n",h[i]);
    return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
int i,h,m1,m2,m3;
m1=0;
m2=0;
m3=0;
for(i=0;i<10;i++)
{
	cin>>h;
	if(h>m1)
	{
		m3=m2;
		m2=m1; 
		m1=h;
	}
	else if(h>m2)
	{
		m3=m2;
		m2=h;
	}
	else if(h>m3)
	{
		m3=h;
	}
}
cout<<m1<<endl;
cout<<m2<<endl;
cout<<m3<<endl;
return 0;
}

C++: #include <iostream>
 
using namespace std;
 
int main() {
 
        int height[10];
        
        for(int i=0;i<10;++i){
                cin >> height[i];
        }
 
        int temp;
        for(int i=0;i<10;++i){
                for(int j=0;j<i;++j){
                        if(height[i]>height[j]){
                                temp = height[j];
                                height[j] = height[i];
                                height[i] = temp;
                        }
                }
        }
 
        cout << height[0] << "\n";
        cout << height[1] << "\n";
        cout << height[2] << "\n";
        
        
        return 0;
}

C++: //
//  main.cpp
//  ListOfHeights
//
//  Created by James Hosken on 28/09/2014.
//  Copyright (c) 2014 James Hosken. All rights reserved.
//

#include <iostream>
#include <stdlib.h>
#include <algorithm>
using namespace std;

int main(int argc, const char * argv[])
{
    
    string input_line;
    
    int *heights;
    heights = new int[0];
    int lineNum = 0;
    
    
    while(cin)
    {
        getline(cin, input_line);
        lineNum++;
        
        //Chunk of array expansion code
        int line = atoi(input_line.c_str());
        int* temp = new int[lineNum];
        copy(heights, heights + lineNum-1, temp);
        delete [] heights;
        temp[lineNum-1] = line;
        heights = temp;
        
    }
    

    sort(heights, heights + lineNum);
    
    for(int i = lineNum-1; i >= lineNum-3; i--)
    {
        cout << heights[i] << endl;
    }

    
}

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

int main(){
    int height[10];
    
    for(int i=0;i<10;i++){
        do{
            cin >> height[i];
        }while(height[i]<0 || height[i]>10000);
    }
    
    sort(height,height+10);
    
    for(int i=9;i>6;i--)
        cout << height[i]<<endl;
    
    return 0;
}

C++: #include<stdio.h>

int main(){
	int m[10],i,j,big;
	for(i=0;i<10;i++){
		scanf("%d",&m[i]);
	}
	for(i=0;i<10;i++){
		for(j=0;j<10;j++){
			if(m[i]>m[j]){
				big=m[i];
				m[i]=m[j];
				m[j]=big;
			}
		}
	}
	for(i=0;i<3;i++){
		printf("%d\n",m[i]);
	}
	return 0;
}