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>
#define N 10

using namespace std;

void swap(int& a, int& b){
	int tmp = a;
	a = b;
	b = tmp;
}

void bubble_sort(int mountain[N]){
	for (int i=(N-1); i>0; --i){
		for (int j=i; j>0; --j){
			if (mountain[j-1] < mountain[j]){
				swap(mountain[j-1], mountain[j]);
			}
		}
	}
}

int main(void){
	int mountain[N];
	for (int i=0; i<N; ++i){
		int tmp;
		do{
			cin >> tmp;
		}while ((tmp<0) || (10000 < tmp));
		mountain[i] = tmp;
	}
	bubble_sort(mountain);
	cout << "output" << endl;
	for (int i=0; i<3; ++i){
		cout << mountain[i] << endl;
	}
	return 0;
}

C++: 
class q2
{
	public static void main(String[] av)
	{
		java.util.Scanner sc = new java.util.Scanner(System.in);
		java.util.ArrayList<Integer> vec = new java.util.ArrayList<Integer>();
		while( sc.hasNextInt() )
		{
			vec.add( sc.nextInt() );	
		}
		java.util.Collections.sort( vec );
		java.util.Collections.reverse( vec );
		for ( int i = 0; i < 3; ++i )
		{
			System.out.println( vec.get(i) );
		}
	}
}

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);
	for(int i=9; i>=7; i--){
		cout << h[i] << endl;
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
    int x[10],i,n,y;
	for(i=0;i<10;i++){
	scanf("%d",&x[i]);
	}
	for(i=0;i<8;i++){
	    for(n=i+1;n<9;n++){
			if(x[i]<x[n]){
				y=x[i];
				x[i]=x[n];
				x[n]=y;
			}
		}
	}
	for(i=0;i<3;i++){
	printf("%d\n",x[i]);
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int n[17];

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

C++: #include <stdio.h> 
using namespace std; 
int main(){

 int count[10001],
tmp,num=3;
 
for(int i=0;i<10001;i++){

count[i]=0;

 for(int i=0;i<10;i++){

 scanf("%d",&tmp);
 count[tmp]++; 
} 

for(int i=10000;i>=0&&num>0;i--){ 

if(count[i]>0){ 

for(int k=0;k<count[i]&&num>0;k++){
 printf("%d\n",i);
 num--; 
}
 } 
} 
}
return 0; }

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

using namespace std;

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

	for (int i = 0; i < 10; i++)
	{
		scanf_s("%d", &h[i]);
		//printf("%d\n", h[i]);
	}

	sort(h, h + 10, std::greater<int>());
	for (int i = 0; i < 3; i++)
	{
		printf("%d\n", h[i]);
	}
	
}

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

int main(){
	
	int first=0;
	int second=0;
	int third=0;
	int n=10;
	int h=0;
	
	for(int i=0;i<n;i++){
		
		cin>>h;
	
		if (h>first){
	
			third=second;
			second=first;
			first=h;
	
			}
	
		else if (h>second){
			
			third=second;
			second=h;
	
	
			}
	
		else if (h>third){
	
			third=h;
	
			}
		
		}
	
		cout<<first<<" "<<second<<" "<<third<<"\n";
	
		return 0;
	
	}

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

int main(){
  int v[10];
  int temp;
  int i,j;

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

  for(i=0;i<9;i++)
    for(j=0;j<9;j++)
      if(v[j]>v[j+1]){
	temp = v[j];
	v[j] =v[j+1];
	v[j+1] = temp;
      }
  for(i=9;i>6;i--)
    cout<<v[i]<<endl;

  return 0;
}

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

int main()
{
	std::array<int,10> mh;
	for (int &el : mh){
		std::cin >> el;
	}
	std::sort(mh.begin(), mh.end());

	std::cout << *(mh.end() -1) << std::endl;
	std::cout << *(mh.end() - 2) << std::endl;
	std::cout << *(mh.end() - 3) << std::endl;

}

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

int main(){
	int a[10];
	stack<int> h;
	for(int i=0;i<10;++i){
		cin>>a[i];
	}
	sort(a,a+10);
	for(int i=0;i<10;++i){
		h.push(a[i]);
	}
	for(int i=0;i<3;++i){
		int ans=h.top();
		cout<<ans<<endl;
		h.pop();
	}
	return 0;
}

C++: #include<iostream> 
#include<algorithm>
using namespace std;
void bubblesort(int A[]){
	for(int i=0;i<10;i++){
		for(int j=10-1;j>i;j--){
			if(A[j]>A[j-1]){
			int t=	A[j-1];
			A[j-1]=A[j];
			A[j]=t;
			}
		}
	}	
}
int main(){
	int A[10];
	for(int i=0;i<10;i++){
		cin>>A[i];
	}
	for(int i=0;i<3;i++)
	{
		bubblesort(A);
		if(i>0)cout<<endl;
		cout<<A[i];
	 } 
}

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

int main(){
	int high[3] = {0}, height;
	while(cin >> height){
		if(high[0] < height){
			high[2] = high[1];
			high[1] = high[0];
			high[0] = height;
		}
		else if(high[1] < height){
			high[2] = high[1];
			high[1] = height;
		}
		else if(high[2] < height)
			high[2] = height;
	}
	for(int i = 0; i < 3; i++)
		cout << high[i] << endl;
    return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int m[10];
	for(int i=0;i<10;i++) cin >> m[i];
	while(1){
		bool j = true;
		for(int i=0;i<9;i++){
			if(m[i]<m[i+1]){
				int t = m[i];
				m[i] = m[i+1];
				m[i+1] = t;
				j = false;
			}
		}
		if(j) break;
	}
	for(int i=0;i<3;i++) cout << m[i] << endl;
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#define N 10
using namespace std;

int main() {
    int data[N];
    for (int i=0; i<N; i++) {
        cin >> data[i];
    }
    sort(data,data+N);
    reverse(data,data+N);
    for (int i=0; i<3; i++) {
        printf("%d\n",data[i]);
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a[10],k=0,tmp,i;
	for(i=0;i<10;i++)
		cin>>a[i];
	while(1){//無限ループ
		for(i=0;i<10;i++){
			if(a[i]<a[i+1]){//もし昇順でない場合
				tmp=a[i];//隣接しあう値を昇順に入れ替える
				a[i]=a[i+1];
				a[i+1]=tmp;
				k++;//カウント
			}
		}
		if(k==0) break;//入れ替える必要がなくなったら終了
		k=0;//カウントの初期化
	}
	
		cout<<a[0]<<"\n"<<a[1]<<"\n"<<a[2]<<endl;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <set>
using namespace std;

int main()
{
	int a = 0 , s=0, d=0, f=0, g=0, h=0, j=0, k=0, l=0, z=0;
	cin >> a;
	cin >> s;
	cin >> d;
	cin >> f;
	cin >> g;
	cin >> h;
	cin >> j;
	cin >> k;
	cin >> l;
	cin >> z;
	int i[10] = { a, s, d, f, g, h, j, k, l, z };
	sort(i, i + 10);
	cout << i[10] << endl;
	cout << i[9] << endl;
	cout << i[8] << endl;

	
	return 0;
}

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

C++: 

#include <stdio.h> #include <functional> #include <algorithm<int main(){ int mt[10], i; std::sort(mt, mt + 10, std::greater<int>); for (i = 0; i < 3; i++) printf("%d", mt[i]);return 0; }

C++: #include<bits/stdc++.h>
int main(){int a[10],i;for(i=0;i<10;i++)scanf("%d",&a[i]);std::sort(a,a+10);printf("%d\n%d\n%d\n",a[9],a[8],a[7]);}

C++: #include<iostream>
#include<stdlib.h>
using namespace std;
int Comp(const void *a,const void *b)
{
	return *(int*)a-*(int*)b;
}
int main()
{
	int i,a[10];
	for(i=0;i<10;i++)
		cin>>a[i];
	qsort(a,10,sizeof(int),Comp);
	for(i=9;i>6;i--)
		cout<<a[i]<<endl;
	return 0;
}

C++: #include<stdio.h>
int main(void){
	int i;
	int a[10];
	int x=0, y=0, z=0;
	
	for(i=0;i<10;i++){
		do{
			printf("山の高さ%d(整数)",i+1);
			scanf("%d",&a[i]);
		}while(a[i]<0||10000<a[i])
		
		if(a[i]>x){
			z=y;
			y=x;
			x=a[i];
		}
		else if(a[i]>y){
			z=y;
			y=a[i];
		}
		else if(a[i]>z){
			z=a[i];
		}
	}
	
	printf("%d\n%d\n%d\n",x,y,z);
	
	return 0;
}