U E D R , A S I H C RSS

정렬/문원명

두번째,.

~cpp 
#include <iostream>
#include <fstream>
using namespace std;


void main()
{
	ifstream fin("UnsortedData.txt");
	ofstream fout("output.txt");
	int arr[10000];
	unsigned long i=0,m=0,n,k=0;
	int temp;
	for(i; i<10000;i++)
	{
		fin>>arr[i];
	}
	
	for(;m<10000;m++)
	{
		for(n=m;n<10000;n++)
		{
			if (arr[m]>arr[n])
			{
				temp=arr[m];
				arr[m]=arr[n];
				arr[n]=temp;
			}
		}
	}

	for(k;k<10000;k++)
	{
		fout<<arr[k]<< endl;
	}

}

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