~cpp 

#include <iostream.h>
#include <fstream.h>

int main()
{
	ifstream fin("input.txt"); 
    ofstream fout("output.txt"); 
	
    int array[10000];
	int temp;


	for (int i =0 ; i < 10000 ; i++)
	{
		int a;
		fin >> a;
		array[i] = a;
	}

	for (int j = 0 ; j < 10000 ; j++)
	{
		for (int k = 0 ; k < 10000 ; k ++)
		{
			if (array[j] < array[k])
			{
				temp = array[j];
				array[j] = array[k];
				array[k] = temp;
			}
		}
	}


	for (int ar = 0 ; ar < 10000; ar++)
	{
		fout << array[ar] << endl; 
	}

	return 0;
}




Retrieved from http://wiki.zeropage.org/wiki.php/정렬/장창재
last modified 2021-02-07 05:30:45