C++实现排序函数Sort,参考代码如下:#includeusing namespace std;#define N 5void Sort(int b[],int n){int i,j,t;for(i=0;ifor(j=0;jif(b[j]>b[j+1]){t=b[j];b[j]=b[j+1];b[j+1]=t;}}int main(){int i,a[N];cout << "输入"<for(i=0;icin >> a[i];Sort(a,N);cout << "升序排列后:"<for(i=0;icout << a[i]<<" ";return 0;}