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 2021-02-07 05:30:45
Processing time 0.0134 sec