Go: package main

import (
        "fmt"
        "sort"
)


func main() {
        var s []int
        var n int
        for i := 0; i < 5; i++ {
                fmt.Scanf("%d", &n)
                s = append(s, n)
        }
        sort.Ints(s)
        for i:= 1; i <= len(s); i++ {
                fmt.Printf("%d", s[len(s)-i])
                if i < len(s) {
                        fmt.Printf(" ")
                }
        }
        fmt.Printf("\n")
}

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

C++: #include <iostream>
using namespace std;
void qs(int*, int);

int main() {
	//int n;
	//cin >> n;
	//int *a=new int[n];
	int a[5];
	for (int i = 0; i < 5; i++) {
		cin >> a[i];
	}
	qs(a, 4);
	for (int i = 4; i > 0; i--)
		cout << a[i] << " ";
	cout << a[0]<<endl;
	return 0;
}


void qs(int *a, int e){
	if (e == 0)
		return;
	int t;
	if (e == 1) {
		if (a[0] > a[1]) {
			t = a[0];
			a[0] = a[1];
			a[1] = t;
		}
		return;
	}
	int p = a[0], lp = -1, rp = e + 1,s=0;
	if (p < a[1])
		p = a[1];
	while (1){
		while (1){
			lp++;
			if (lp == e) {
				qs(a, e - 1);
				return;
			}
			if (lp == rp) {
				s = 2;
				break;
			}
			if (a[lp] >= p)
				break;
		}
		if (s == 0) {
			while (1) {
				rp--;
				if (rp == 0) {
					qs(a + 1, e - 1);
					return;
				}
				if (lp == rp) {
					s = 1;
					break;
				}
				if (a[rp] < p)
					break;
			}
		}
		if (s == 1) {
			qs(a, lp-1);
			qs(a + lp, e - lp);
			return;
		}
		if (s == 2) {
			qs(a, rp - 1);
			qs(a + rp, e - rp);
			return;
		}
		t = a[lp];
		a[lp] = a[rp];
		a[rp] = t;
	}
}