~cpp 
#include <fstream> 
using namespace std; 
const int Max = 10000;
int main() 
{ 
    ifstream fin("UnsortedData.txt"); 
    ofstream fout("output.txt"); 
	
	int arr[Max];

	for(int i=0; i < Max; i++)
	{
		fin >> arr[i];
	}

	for(int j=0; j < Max; j++)
	{
		int temp;
		for(int k=0; k < Max; k++)
		{
			if(arr[j] < arr[k])
			{
				temp = arr[j];
				arr[j] = arr[k];
				arr[k] = temp;
			}
		}			
	}
	
	for(i=0; i < Max; i++)
		fout << arr[i] << endl; 

	return 0; 
} 

Retrieved from http://wiki.zeropage.org/wiki.php/정렬/방선희
last modified 2021-02-07 05:30:45