U E D R , A S I H C RSS

정렬/민강근

~cpp 
#include <fstream>
#include <iostream>
using namespace std; 
 
int main() 
{ 
    ifstream fin("UnsortedData.txt");
    ofstream fout("output.txt");
	
	int ar[10000];
	int x;
	for(int i=0;i<10000;i++)
	{
		int tem;
		fin >> tem;
		ar[i] = tem;
	}

	for(int j=0;j<10000;j++)
	{
		for (int k = 0 ; k < 10000 ; k++)
		{
			if(ar[j]<ar[k])
			{
			x=ar[j];
			ar[j]=ar[k];
			ar[k]=x;
			}
		}
	}
	
	for (int p = 0 ; p<=10000 ; p++)
	{
		fout << ar[p]<<endl;
	}
			
	return 0; 
} 

---
강근
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2009-05-27 07:09:19
Processing time 0.0244 sec