0
/*這個函數在main中被調用。它用於冒泡排序*/爲什麼我在使用遞歸的冒泡排序代碼中出現運行時錯誤
void sort(int a[], int n) //parameters passed:array to be sorted, no.of
// elements in the array
{ int count=0;
for(int i=0;i<n-1;i++)
{ if(a[i+1]<a[i]) // if the next element is greater in value
{
int temp=a[i+1]; // the numbers
a[i+1]=a[i]; // are
a[i]=temp; // swapped;i want increasing order
}
else count++;
}
if(count==n)
return;
else sort(a,n);
return; }