U E D R , A S I H C RSS

정렬/장창재

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

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:30:45
Processing time 0.0132 sec