#include<stdio.h>
#include
BubbleSort(RecType R[],int n) //冒泡排序
{ int i,j;
bool exchange;
for(i=0;i<n-1;i++)
{ exchange=false;
for(j=n-1,j>i;j–)
if(R[j].key<R[j-1],key)
{swap(R[j],R[j-1]}
exchange=true;
}
{ printf(“i=%d:归位元素%d,排序结果:”,i,R[i].key);
DispList(R,n);
if(!exchange)
return;
}
}
int main()
{ int n=10;
recType R[MXAL];
printf(“排序前:”):DispList(R,n);
BubbleSort(R,n);
printf(“排序后:”);DispList(R,n);
return i;
}
报错:[Error] expected constructor, destructor, or type conversion before ‘(’ token
为什么会报这个错误呢?(注:编译器Devc++)
冒泡排序
最新推荐文章于 2020-06-17 13:28:47 发布