冒泡排序的代码:
参照了网页http://student.zjzk.cn/course_ware/data_structure/web/paixu/paixu8.3.1.1.htm
对该文的作者表示感谢!
以下是本人的冒泡排序的部分代码,
希望能提供给各位需要的。
int a[8] = {49,38,65,97,76,13,27,49};
int temp;
for(int i=0;i<8;i++)
for(int j=0;j<7-i;j++)
{
if(a[j+1]>a[j])
{
temp = a[j+1];
a[j+1] = a[j];
a[j] = temp;
}
}
1万+

被折叠的 条评论
为什么被折叠?



