새싹교실/2017/꽃밭/0502 (rev. 1.2)
#include <stdio.h>
int main()
{
int arr
10 = { -1,2,8,-9,-10,6,5,4,3,0 };
int i, j, temp = 0;
printf("정렬전");
for (i = 0; i < 10; i++)
printf("\n정렬후:");
for (i = 0; i < 10; i++)
{
for (j = 0; j< 9; j++)
{
if (arr
j > arr
j + 1)
{
temp = arr
j;
arr
j = arr
j + 1;
arr
j + 1 = temp;
}
}
}
for (i = 0; i < 10; i++)
printf("\n");
system("pause");
return 0;
}