U E D R , A S I H C RSS

정렬/aekae

정렬

~cpp 
#include <fstream> 
using namespace std; 
 
int main() 
{ 
        ifstream fin("input.txt"); 
        ofstream fout("output.txt"); 

		int number[10000];

		int i,j,k,temp;

		for (i=0; i<10000; i++)
			fin >> number[i];
		for (j=0; j<10000; j++)
		{
			for (k=0; k<10000; k++)
			{
				if (number[j] < number[k])
				{
					temp = number[j];
					number[j] = number[k];
					number[k] = temp;
				}
			}
		}		
 
		for (i=0; i<10000; i++)
			fout << number[i] << endl; 
        return 0; 
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:30:45
Processing time 0.0114 sec