Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextInt() int {
	scanner.Scan()
	i, e := strconv.Atoi(scanner.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func main() {
	scanner.Split(bufio.ScanWords)
	nums := make([]int, 5)
	for i := 0; i < 5; i++ {
		nums[i] = nextInt()
	}
	sort.Sort(sort.Reverse(sort.IntSlice(nums)))
	for i, v := range nums {
		if i == len(nums)-1 {
			fmt.Printf("%d\n", v)
		} else {
			fmt.Printf("%d ", v)
		}
	}
}

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

int main()
{
    int a[5];
    for (int i = 0; i < 5; ++i) std::cin >> a[i];
    std::sort(a, a + 5, std::greater<int>());
    std::cout << a[0];
    for (int i = 1; i < 5; ++i) std::cout << a[i];
    std::cout << std::endl;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    int a[5];
    for(int i=0;i<5;++i)cin>>a[i];
    sort(a,a+5);
    reverse(a,a+5);
    for(int i=0;i<5;++i){
        if(i!=4)cout<<a[i]<<" ";
        else cout<<a[i]<<endl;
    }
}

C++: #include <stdio.h>
#define NUMBER 5

int main() {
	int input[NUMBER];
	int temp;
	int last_ch = NUMBER - 1;
	int temp_ch;

	int i;

	for(i = 0; i < NUMBER; i++)
		scanf("%d", &input[i]);

	/* 左の方が小さかった場合には入れ替える。 */
	while(last_ch) {
		temp_ch = 0;
		for(i = 0; i < last_ch; i++) {
			if(input[i] < input[i + 1]) {
				temp = input[i];
				input[i] = input[i + 1];
				input[i + 1] = temp;
				temp_ch = i + 1;
			}
		}
		last_ch = temp_ch;
	}
	
	for(i = 0; i < NUMBER - 1; i++) 
		printf("%d ", input[i]);

	printf("%d\n", input[NUMBER - 1]);

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int a[5],tmp;
  for(int i=0;i<5;i++){
    cin >> a[i];
  }
  for(int i=0;i<5;i++){
    for(int j=0;j<4;j++){
      if(a[j] < a[j+1]){
	tmp = a[j];a[j] = a[j+1]; a[j+1] = tmp;
      }
    }
  }
    for(int i=0;i<4;i++){
      cout << a[i] << " ";
    }
    cout << a[4] << endl;
}

C++: //#define _USE_MATH_DEFINES
//#include <cmath>
#include <iostream>
//#include <stdio.h>
//#include <stdlib.h>
//#include <iomanip>
#include <vector>
//#include <string>
//#include <algorithm>
//#include <functional>
//#include <time.h>
//#include <sstream>
#include <queue>

using namespace std;


int main(){

	int buf;
	priority_queue <int> pq;

	while (cin >> buf){
		pq.push(buf);
	}

	while (pq.size()){
		cout << pq.top() << " ";
		pq.pop();
	}

	return 0;
}

C++: #include<iostream>

int main(){
	int a[5],i,j,n;
	for(i=0;i<5;i++){
	std::cin>>a[i];
	}
	for(i=0;i<4;i++){
		for(j=i+1;j<5;j++){
			if(a[i]<a[j]){
			n=a[i];
			a[i]=a[j];
			a[j]=n;
			}
		}
	}
	std::cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<" "<<a[3]<<" "<<a[4]<<std::endl;
	return 0;
}

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

using namespace std;


void BubbleSort(vector <int> &num)
{
      int i, j, flag = 1;    // set flag to 1 to start first pass
      int temp;             // holding variable
      int numLength = num.size( ); 
      for(i = 1; (i <= numLength) && flag; i++)
     {
          flag = 0;
          for (j=0; j < (numLength -1); j++)
         {
               if (num[j+1] > num[j])      // ascending order simply changes to <
              { 
                    temp = num[j];             // swap elements
                    num[j] = num[j+1];
                    num[j+1] = temp;
                    flag = 1;               // indicates that a swap occurred.
               }
          }
     }
     return;   //arrays are passed to functions by address; nothing is returned
}

int main()
{
    int input;
    vector<int> input_array;
    while(cin >> input){
        input_array.push_back(input);
    }
    BubbleSort(input_array);
    for(auto num:input_array){
        cout << num << " ";
    }
    
}

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

int main() {
  int n = 5;
  int a[n];
  for(int i=0;i<n;i++) {
    cin >> a[i];
  }
  sort(a,a+n);
  for(int i=n-1;i>=0;i--) {
    cout << a[i] << (i == 0 ? "\n" : " ");
  }
}

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

using namespace std;

int main(){
  int a[5],i,j,min,min_n;

  for(i=0;i<5;i++)
    scanf("%d",&a[i]);

  for(i=0;i<5;i++){
    min=a[i]; min_n=i;
    for(j=i+1;j<5;j++){
      if(min<a[j]){
        min=a[j]; min_n=j;
      }
    }
  swap(a[i],a[min]);
  printf( i<4 ? "%d " : "%d\n",a[i]);
  }
  return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int n[5];
  for(int i=0;i<5;i++) cin >> n[i];
  sort(n,n+5,greater<int>());
  for(int i=0;i<5;i++){
    if(i!=4) cout << n[i] << ' ';
    else cout << n[i] << endl;
  }
  return 0;
}

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

int main() {
	const int size = 5;
	int arr[size];
	std::cin
		>> arr[0]
		>> arr[1]
		>> arr[2]
		>> arr[3]
		>> arr[4];

	// sort
	for (int i = 0; i < size; i++)
		for (int j = i + 1; j < size; j++)
			if (arr[i] < arr[j]) {
				std::swap(arr[i], arr[j]);
				continue;
			}
			

	// show
	for (int i = 0; i < size; i++)
		std::cout << arr[i] << " ";

	std::cout << std::endl;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main() {
	int a[5];
	for(int i=0;i<5;i++) cin >> a[i];
	sort(a, a+5);
	cout << a[4];
	for(int i = 3; i>=0; i-- ) cout << " " << a[i];
	cout << endl;
	return 0;
}

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

int main() {
  int n[5];

  for (int i = 0; i < 5; i++) {
    cin >> n[i];
  }
  sort(n, n + 5);
  
  cout << n[4] << " " << n[3] << " " << n[2] << " " << n[1] << " " << n[0] << endl;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
  long long a[5];
  for(int i=0;i<5;i++){
    cin >> a[i];
  }
  sort(a,a+5);
  reverse(a,a+5);
  for(int i=0;i<5;i++){
    if(i>0){
      cout << ' ';
    }
    cout << a[i];
  }
  cout << endl;
  return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int a[5];
	for(int i=0;i<5;i++){
		cin>>a[i];
	    }
	sort(a,a+5);
	reverse(a,a+5);
	cout<<a[0];
	for(int j=1;j<=5;j++){
		cout<<" "<<a[j];
	    }
	cout<<endl;
	return 0;
	}

C++: // Sorting Five Numbers

#include <iostream>
using namespace std;

int main() {
    int array[5];
    int tmp;

    for (int i = 0; i < 5; i++)
        cin >> array[i];

    for (int i = 0; i < 5; i++) {
        for (int j = 4; j > i; j--) {
            if (array[j-1] < array[j]) {
                tmp = array[j-1];
                array[j-1] = array[j];
                array[j] = tmp;
            }
        }
    }

    for (int i = 0; i < 5; i++) {
        if (i) cout << ' ';
        cout << array[i];
    }
    cout << '\n';
    return 0;
}

C++: #include<iostream>
int main()
{
	int n[5];
	for (int i = 0; i < 5; i++)
	{
		std::cin >> n[i];
	}
	for (int i = 0; i < 5; i++)
	{
		int max = INT_MIN, max_index = 0;
		for (int j = i; j < 5; j++)
		{
			if (max < n[j])
			{
				max = n[j];
				max_index = j;
			}
		}
		std::swap(n[i], n[max_index]);
	}
	for (int i = 0; i < 5; i++)
	{
		std::cout << n[i] << ' ';
	}
	std::cout << std::endl;
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<functional>
using namespace std;
int main(){
	int a[5];
	for(int i=0;i<5;i++) cin>>a[i];
	sort(a,a+5,greater<int>());
	for(int i=0;i<5;i++) cout<<a[i]1;
}

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

int main() {
  int n[5];

  for (int i = 0; i < 5; i++) {
    cin >> n[i];
  }
  sort(n, n + 5);
  for (int i = 4; i >= 0; i--) {
    cout << n[i] << endl;
  }
}

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

int main(){
	int a[5];
	for(int i = 0; i < 5; i++){
		cin >> a[i];
	}
	sort(a,a+5);
	cout << a[4];
	for(int i = 1; i < 5; i++){
		cout << " " << a[4-i];
	}
	cout << endl;
}

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

int main(){
	
	int d[5];
	for(int i=0;i<5;i++)cin>>d[i];
	sort(d, d+5, greater<int>());
	for(int i=0;i<5;i++)cout<<d[i]<<(i==4?"\n":" ");
	
	return 0;
}