All pastes #979596 Raw Edit

Stuff

public text v1 · immutable
·published 2008-04-10 13:41 UTC
rendered paste body
#include <stdio.h>
#define SIZE 10
int main()
{
int a[SIZE] = {2, 3, 1, 7, 9, 12, 4, 8, 19, 10};
int i, k, temp, j;
for (i = 0; i < SIZE - 1; ++i)
for (k = 0; k < SIZE -1 - i; ++k)
if (a[k] > a[k + 1]) {
temp = a[k];
a[k] = a[k + 1];
a[k + 1] = temp;
for (j = 0; j < SIZE; ++j)
printf("%d ", a[j]);
printf(" i=%d k=%d",i, k);
printf("\n");
}
for (k = 0; k < SIZE; ++k)
printf("%d ", a[k]);
getch();
return 0;
}