冒泡排序
#include <stdio.h>
#define N 10
int main()
{
int a[N] = { 3,4,6,1,8,2,5,0,7,9 };
int temp, i, j;
for (i = 0; i < N - 1; i++)
for (j = 0; j < N - i - 1; j++)
if (a[j] > a[j + 1])
{
temp = a[j + 1];
a[j + 1] = a[j];
a[j] = temp;
}
printf("排序后结果为:\n");
for (i = 0; i < N; i++)
printf("%d",a[i]);
}