U E D R , A S I H C RSS

정렬/손동일

~cpp 
#include <iostream>
using namespace std;

void main()
{
	int arr[10] = {1,5,3,8,10,6,4,7,9,2};
	
	int i,j;

	for(i=0; i<9; i++)
	{
		for (j=i+1; j<10; j++)
		{
			if (arr[i]> arr[j])
			{
				int swap;
				swap = arr[j];
				arr[j] = arr[i];
				arr[i] = swap;
			}
		}
	}
	
	

	for(i=0; i<10; i++)
		cout << arr[i];

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