1using System;
2public class MySort ...{
3 public static void SelectionSort(ref int[] intNum) ...{
4 int temp = 0;
5 for (int i = 0; i < intNum.Length - 1; i++) ...{
6 for (int j = i + 1; j < intNum.Length; j++) ...{
7 if (intNum[i] > intNum[j]) ...{
8 temp = intNum[i];
9 intNum[i] = intNum[j];
10 intNum[j] = temp;
11 }
12 }
13 }
14 }
15}
16public class 선택정렬 ...{
17 public static void Main() ...{
18 //[1] Input
19 int[] intNum = ...{3, 2, 1, 6, 3, 2, 9, 10, 5, 4};
20 //[2] Process : Select Sort
21 MySort.SelectionSort(ref intNum);
22 //[3] Output
23 for (int i = 0; i < intNum.Length; i++) ...{
24 Console.WriteLine(intNum[i]);
25 }
26 }
27}