冒泡排序 编译也没出错为什么得不到答案啊
# include <stdio.h>void sort (int * a, int len) //sort 排序
{
int i, j, t;
for (i = 0; i < len-1; ++i)
{
for (j = 0; j < len-1-i; ++j)
{
if (a[j] > a[j+1]) // >是升序 <是降序
{
t = a[j];
a[j] = a[j+1];
a[j+1] = t;
}
}
}
}
int main(void)
{
int a[6] = {10, 2, 8, -8, 11, 0};
int i = 0;
sort (a, 6);
for (i = 0; i < 6; ++i);
{
printf("%d", a[i]);
}
printf("\n");
return 0;
}
各位大神帮帮忙 小弟新手 出错在哪里了??