Go: package main

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

var (
	n  = 10
	sc = bufio.NewScanner(os.Stdin)
)

func main() {
	heights := make([]int, n, n)
	for i := 0; i < n; i++ {
		sc.Scan()
		heights[i], _ = strconv.Atoi(sc.Text())
	}
	sort.Sort(sort.Reverse(sort.IntSlice(heights)))

	for i := 0; i < 3; i++ {
		fmt.Println(heights[i])
	}
}

C++: #include<iostream>
using namespace std;
int main() {
	int mountain[10];
	for (int i = 0; i < 10; i++) {
		cin >> mountain[i];
	}

	int taller[3];
	int a, b, c;

	a = mountain[0];
	b = mountain[1];
	c = mountain[2];

	for (int y = 3; y <= 9; y++) {
		if (a <= b) {
			if (a <= c) {
				if (a < mountain[y]) {
					a = mountain[y];
				}
			}
			else {
				if (c < mountain[y]) {
					c = mountain[y];
				}
			}
		}
		else if (b <= c)
		{
			if (b < mountain[y]) {
				b = mountain[y];
			}
		}
	}

	//biggest->taller[0],bigger->taller[1],taller[2]
	{
		if (a >= b&&a >= c)
		{
			taller[0] = a;
			if (b >= c)
			{
				taller[1] = b;
				taller[2] = c;
			}
			else {
				taller[1] = c;
				taller[2] = b;
			}
		}
		if (b >= a&&b >= c)
		{
			taller[0] = b;
			if (a >= c)
			{
				taller[1] = a;
				taller[2] = c;
			}
			else {
				taller[1] = c;
				taller[2] = a;
			}
		}
		if (c >= b&&c >= a)
		{
			taller[0] = c;
			if (b >= a)
			{
				taller[1] = b;
				taller[2] = a;
			}
			else {
				taller[1] = a;
				taller[2] = b;
			}
		}
	}

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

	char a____;
	cin >> a____;

	return 0;
}

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

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

C++: #include<iostream>
using namespace std;
int main(){
	
	int a[10],max,max2,max3;
	for(int i=0;i<10;i++){
		cin>>a[i];
	}
	max=a[0];
	max2=a[0];
	max3=a[0];
	for(int b=1;b<10;b++){
		if(max<a[b]){
			max=a[b];
		}
	}
	for(int c=1;c<10;c++){
		if(a[c]!=max){
			if(a[c]>max2){
				max2=a[c];
			}
		}
	}
	for(int d=1;d<10;d++){
		if(a[d]!=max&&a[d]!=max2){
			if(max3<a[d]){
				max3=a[d];
			}
		}
	}
	cout<<max<<endl;
	cout<<max2<<endl;
	cout<<max3<<endl;
	
	return 0;
}

C++: #include <stdio.h>
#include <cmath>
#include <algorithm>
using namespace std;

int main() {
	int buf[3]={-1}, h, count=0;
	
	while(scanf("%d", &h) != EOF) {
		count++;
		if(h >= min(buf[0], min(buf[1], buf[2]))) {
			sort(buf, buf+3);
			reverse(buf, buf+3);
			buf[2] = h;
		}
	}
	sort(buf, buf+3);
	reverse(buf, buf+3);
	if(count <3) {
		for(int i=1; i<=count; i++) {
			printf("%d\n", buf[i-1]);
		}
	}
	else {
		for(int i=1; i<=3; i++)
			printf("%d\n", buf[i-1]);
	}
	return 0;
}

C++: #include <stdio.h>
int main(void)
{
	int a[11];
	int b;
	int i;
	int m1=0;
	int m2=0;
	int m3=0;
	for (b=1;b<11;b++)
	{
		scanf("%d", &a[b]);
	}
	for(i = 0;i < 10;i++)
	{
		for (b=1;b<11;b++)
		{
			if (m1<a[b])
			{
				m1=a[b];
			}
			else if (a[b]==m1)
			{
				m2=a[b];
			}
			else if (m2<=a[b] && m1>m2)
			{
				m2=a[b];
			}
			else if (a[b]==m2)
			{
				m3=a[b];
			}
			else if (m3<=a[b] && m2>m3)
			{
				m3=a[b];
			}
		}
	}
	printf("%d\n%d\n%d\n", m1, m2, m3);
	return 0;
}

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

#define M 10
#define REQUIRED 3

bool ascending (int i, int j) { return i > j; }

int main() {
  vector<int> heights(M, 0);
  for (int i = 0; i < M; i++) {
    cin >> heights[i];
  }

  std::sort(heights.begin(), heights.end(), ascending);
  for (int i = 0; i < REQUIRED; i++) {
    cout << heights[i] << endl;
  }
  
  return 0;
}

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

using namespace std;

int main()
{
	vector<int> data;
	int temp;

	for (int ix = 0; ix != 10; ++ix){
		cin >> temp;
		data.push_back(temp);
	}

	sort(data.begin(), data.end());
	for (int ix = 0; ix != 3; ++ix)
		cout << data[ix] << endl;

	return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
using namespace std;
int main(){
  int h[10];
  rep(i,10){
    cin >> h[i];
  }
  sort(h,h+10);
  reverse(h,h+10);
  rep(i,3){
    cout << h[i] << endl;
  }
  return 0;
}

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

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

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

int main(){
  vector<int> v;
  for(int i=0;i<10;i++){
    int m;
    cin >> m;
    v.push_back(m);
  }


  sort(v.begin(), v.end(), greater<int>());

  cout << v.at(0) << endl;
  cout << v.at(1) << endl;
  cout << v.at(2) << endl;

  return 0;
}

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

C++: //	created : 16/03/15
// 	author   : Rp7rf
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <set>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define rep(i,a) for(int i = 0 ; i < a ; i ++)
#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define vi vector<int>
#define mp make_pair
#define pb push_back
#define MOD 1000000007
#define INF 1e9
 
int main(void){
    int q;
    string a,b;
    cin>>q;
    while(q--){
        cin>>a>>b;
        int dp[1010][1010] = {0};
        for(int j = 0 ; j < a.size() ; j ++){
            for(int i = 0 ; i < b.size() ; i ++){
                if(a[j] == b[i]){
                    dp[j+1][i+1] = dp[j][i]+ 1;
                }else{
                    dp[j+1][i+1] = max(dp[j][i+1],dp[j+1][i]);
                }
            }
        }
        cout<<dp[a.size()][b.size()]<<endl;
    }
}

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

using namespace std;

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

C++: #include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
int i,j,arr[20];

for(i=1;i<=10;i++)
{

sort(arr,arr+3);
printf("%d\n",arr[i]);
}
return 0;
}

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

int main(){
    vector<int> v(10);
    for(int i=0;i<10;i++)cin >> v[i];
    sort(v.rbegin(), v.rend());
    for(int i=0;i<3;i++)cout << v[i] << endl;
    return 0;
}

C++: #include<stdio.h>
#include<algorithm>
main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}

C++: #include<stdio.h>
      
int main(void){
      
    /* 宣言と初期化 */
    int hai[10];
    int id[2]
    int i;
    int temp2nd;
    int temp3rd;
    int tempmax;
      
for(i=0;i<10;i++)
{
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];id[0]=i;}
    }
      
    for(i=0;i<10;i++){
        /*2番目求める */
        if(hai[i]<tempmax&&hai[i]>temp2nd&&i=!hai[0])
        {temp2nd=hai[i];hai[1]=i;}
    }
      
    for(i=0;i<10;i++){
        /* 3番目求める */
        if(hai[i]>temp3rd&&hai[i]<temp2nd&&i=!hai[1]&&i=!hai[0])
       {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 m[10];

int main() {

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

    sort(m, m + 10);

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

    return 0;
}