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>
#include<vector>
int main(){
	std::vector<int> vec(10);
	for(int i=0;i<10;i++){
		std::cin>>vec[i];
	}
	int a=0;
	for(int i=0;i<10;i++){
		if(a<vec[i])a=vec[i];
	}
	std::cout<<a<<std::endl;
	int b=0;
	for(int i=0;i<10;i++){
		if(vec[i]==a)vec[i]=0;
		if(b<vec[i])b=vec[i];
	}
	std::cout<<b<<std::endl;
	int c=0;
	for(int i=0;i<10;i++){
		if(vec[i]==b)vec[i]==0;
		if(c<vec[i])c=vec[i];
	}
	std::cout<<c<<std::endl;
	return 0;
}

C++: #include <stdio.h>
void sortarry(int* Array,int n )
{
int Tmp=0;
int i=0;
int j=0;

for(i=0;i<n-1;i++)
{
for(j=i+1;j<n;j++)
{
if(Array[i]<Array[j] )
{
Tmp=Array[i];
Array[i]=Array[j];
Array[j]=Tmp;
}
}
}

return ;
}

int main( void )
{
int Array[10];
int i=0;

for(i=0;i<10;i++ )
{
scanf("%d",&Array[i] );
}
sortarry(Array,10 );

for(i=0;i<3;i++)
{
printf("%d\n",Array[i] );
}
}

C++: #include <iostream>

int main(int argc, const char * argv[])
{
    using namespace std;
        int max = 0;
        int second = 0;
        int third = 0;
    
    int n[10];
    
    for(int i = 0; i < 10; i++) cin >> n[i];
    sort(n,n+10,greater<int>());
    max = n[0];
    second = n[1];
    third  = n[2];
    cout << max << "\n" << second << "\n" << third << "\n";
    return 0;
}

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

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

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

int main() {
	// your code goes here
	int data[10],ansdata[3];
	for (int j = 0;j<3;j++) {
		ansdata[j] = 0;
	}
	for (int i=0;i<=9;i++) {
		cin >> data[i];
		if (i==0) {
			ansdata[0] = data[i];
		}
		if (i>0) {
			if (data[i] > ansdata[2]) {
				if (data[i] > ansdata[1]) {
					ansdata [2] = ansdata [1];
					if (data[i] > ansdata[0]) {
						ansdata [1] = ansdata [0];
						ansdata [0] = data [i];	
					}
					else {
						ansdata[1] = data[i];
					}
					
				}
				else {
					ansdata[2] = data[i];
				}
			}

		}
	}
	cout << ansdata[0] << endl << ansdata[1] << endl << ansdata [2] <<endl;
	return 0;
}

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


using namespace std;

int main()
{
    int A[10],i;
    
    for(i=0; i<=9; i++)
    {
    cin >> A[i];         
    }
    
    sort(A,A+10);
    reverse(A,A+10);
    
    for(i=0; i<=2; i++)
    {
    cout<< A[i] << endl;         
    }
    
    return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
#define REP(i,m,n) for(long long i=m;i<n;++i)
#define INF 10000000000000000
#define MOD 1000000007
#define ll long long
#define mp make_pair
#define all(v) v.begin(),v.end()

vector<int>v;

int main(){
	REP(i,0,10){
		int tmp;
		cin>>tmp;
		v.push_back(tmp);
	}
	sort(all(v));
	printf("%d\n%d\n%d\n",v[9],v[8],v[7]);
	return 0;
}

C++: #include<iostream>
#include<array>
int main(void){
std::array<int,10> h;
int tmp;
for(auto& e : h){
std::cin>>e;
}
std::sort(h.begin(),h.end());
for(int i=0;i<3;i++){
std::cout<<h[i]<<std::endl;
}

return 0;
}

C++: //http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0001&lang=jp
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <map>

using namespace std;


int main(){
	int n = 10;
	int a[n];
	for(int i=0; i<n; i++){
		cin >> a[i];
	}
	sort(a, a+n);
	printf("%d\n", a[9]);
	printf("%d\n", a[8]);
	printf("%d\n", a[7]);


	return 0;

}

C++: #include <cstdio>
#define MAX 10

int* sort(int* array);

int main(){
	int array[MAX];
	
	for(int i = 0; i < MAX; i++){
		array[i] = 0;
		scanf("%d", &array[i]);
	}
	
	sort(array);
	
	for(int i = MAX - 1; i > 6; i--){
		printf("%d\n", array[i]);
	}
	return 0;
}

int* sort(int* array){
    int temp = 0;
    for(int i = 0; i < MAX; i++){
        for(int j = 0; j < MAX - i - 1; j++){
            if(array[j] > array[j + 1]){
                temp = array[j];
                array[j] = array[j + 1];
                array[j + 1] = temp;
            }
        }
    }
    return array;
}

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

int main(){
	vector<int> h;
	for(int i=0; i<10; ++i){
		int input;
		scanf("%d", &input);

		h.push_back (input);	
	}

	std::sort(h.begin(), h.end(),std::greater<int>());

	for(int i=0; i<3; ++i) printf("%d\n", h[i]);

	return 0;
}

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

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

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

using namespace std;

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

	partial_sort( hills, hills + 3, hills+9, greater<int>() );
    
    for(int i=0;i<3;i++){
        cout << hills[i] <<endl;
    }
	return 0;
}

C++: #include<stdio.h>
  
int main(void){
  
    /* 宣言と初期化 */
    int hai[10];
    int i;
    int temp2nd;
    int temp3rd;
    int tempmax;
  
for(i=0;i<10;i++)
{
printf("山の高さ　");
scanf("%d",hai[i]);
}
    /* 代入 */
    temp2nd=hai[0];
    tempmax=hai[0];
    temp3rd=hai[0];
  
    /* 計算 */
    for(i=0;i<10;i++){
        /* 最大値求める */
        if(hai[i]>tempmax)
        tempmax=hai[i];
    }
  
    for(i=0;i<10;i++){
        /*2番目求める */
        if(hai[i]<tempmax&&hai[i]>temp2nd)
        temp2nd=hai[i];
    }
  
    for(i=0;i<10;i++){
        /* 3番目求める */
        if(hai[i]>temp3rd&&hai[i]<temp2nd)
        temp3rd=hai[i];
    }
  
    /* 表示 */
    printf("最も高い山の高さ　%d\n",tempmax);
    printf("２番目に高い山の高さ　%d\n",temp2nd);
    printf("３番目に高い山の高さ　%d\n",temp3rd);
  
    return 0;
}

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

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

C++: #include <iostream>

int mt[] = {
1819,
2003,
876,
2840,
1723,
1673,
3776,
2848,
1592,
922
};

int main() {
	int limit = 10000;
	for ( int j = 0; j < 3; j++ ) {
		int max = 0;
		for ( int i = 0; i < 10; i++ ) {
			if ( max < mt[ i ] && mt[ i ] < limit ) {
				max = mt[ i ];
			}
		}
		std::cout << max << std::endl;
		limit = max;
	}
}

C++: #include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
    int height[10];
    for(int i=0;i<10;i++)
    {
        scanf("%d",&height[i]);
    }
    int temp;
    for(int i=0;i<10;i++){
            for(int j=i+1;j<=10;j++){
        if(height[i]<height[j]){
                temp=height[i];
            height[i]=height[j];
            height[j]=temp;
        }

            }

    }

for(int i=0;i<3;i++){
    printf("%d\n",height[i]);
}
    return 0;
}