#include
int main()
{
int a[] = {12, 31, 14, 15, 29, 10, 23, 89, 112, 108};
for(int i = 0; i < 10; i++)
{
for (int j = 0; j < 10- i- 1; j++)
{
if (a[j] > a[j+1])
{
int tmp = a[j];
a[j] = a[j+1];
a[j+1] = tmp;
printf("%d %d ", a[j], a[j+1]);
}
}
}
printf("\n");
for (int i = 0; i< 10; i++)
{
printf("%d ", a[i]);
}
return 0;
}