새싹교실/2017/내무반/박채린/BubbleSort (rev. 1.2)
void main() {
int temp, i, j;
int arr[] = { 55,07,78,12,42 };
for (i = 4; i >= 1; i--) {
for (j = 1; j <= i; j++)
if (arr
j - 1 > arr
j) {
temp = arr
j - 1;
arr
j - 1 = arr
j;
arr
j = temp;
}
}
for (i = 0; i < 5; i++)
printf("%d\n", arr
i);
return 0;
}