Go: package main

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

func getsAsIntArray() (line []int) {
	scanner := bufio.NewScanner(os.Stdin)

	for scanner.Scan() {
		str := scanner.Text()
		if str == "" {
			break
		}
		data, err := strconv.Atoi(str)
		if err != nil {
			break
		}
		line = append(line, data)
	}

	return
}

func main() {

	lines := getsAsIntArray()
	sort.Sort(sort.Reverse(sort.IntSlice(lines)))
	for i, v := range lines {
		if i < 3 {
			fmt.Println(v)
		}
	}
}

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;
}

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

using namespace std;

int main(){
  vector<int> v;
  for(int i = 0; i < 10; i++){
    int b;
    cin >> b;
    v.push_back(b);
  }
  sort(v.begin(), v.end(), greater<int>());
  cout << v[0] << endl << v[1] << endl << v[2] << endl;
}

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

int main(){

	int hill[]={0,0,0,0,0,0,0,0,0,0};

	for(int j=0;j<=9;j++){
		cin>>hill[j];
	}

	int key;
	int flag;

	//sort
	for(key=9;key>=0;key--){

		for(int i=0;i<=key;i++){
			if(hill[i]>hill[i+1]){
				flag=hill[i];hill[i]=hill[i+1];hill[i+1]=flag;
			}
		}

	}

	cout<<hill[9]<<"\n"<<hill[8]<<"\n"<<hill[7]<<endl;

	return 0;

}

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

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

C++: #include<iostream>

//関数の宣言
void sort(int mountain[10]);

int main(){
	
	const int a = 10;
	int mountain[a];
	
	for (int i = 0; i < 10; ++i){
		std::cin >> mountain[i];
	}
	sort(mountain);

	for (int i = 0; i < 3; i++){
		std::cout << mountain[i] << std::endl;
	}
	return 0;
}


//関数の定義
void sort(int mountain[10]){
	for (int i = 0; i < 9; ++i){
		for (int j =i+1; j < 10; ++j){
			if (mountain[i] < mountain[j]){
				int tmp = mountain[i];
				mountain[i] = mountain[j];
				mountain[j] = tmp;
			}
		}
	}
}

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

int main() {
/*	int a[3];
	cin >> a[0] ;
	a[1] = 3;
	a[2] = a[0] * 10;

	cout << a[0] <<" " << a[1] <<" "<< a[2] << endl;
	
	for (int i = 0; i < 3; i++) {
		cout << a[i] << endl;
	}


	sort(a,a+5);
*/
	int a[10];
	for (int i = 0; i < 10; i++) {
		cin >> a[i];
	}
	
	sort(a,a+10,greater<int>());

	for (int i = 0; i < 3; i++) {
		cout << a[i]<<endl;
	}

	return 0;
}

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

static void input(std::vector<int>& hills)
{
    int val = 0;
    
    if (0x00 == &hills) {
        std::cerr << "hills is null" << std::endl;
        exit (1);
    }
 
    while (std::cin >> val) {
        hills.push_back(val);
    }
}

static int getMax(std::vector<int>& hills)
{
    if (0x00 == &hills) {
        std::cerr << "hills is null" << std::endl;
        exit (1);
    }

    std::sort(hills.begin(), hills.end());
    int ret = hills.back();
    hills.pop_back();

    return ret;
}

int main()
{
    std::vector<int> vec;

    input(vec);
    for (int i = 0; i < 3; i++) {
        std::cout << getMax(vec) << std::endl;
    }

    return 0;
}