//填写排序函数下面该怎么写

#include <iostream.h> #include <stdlib.h> #include <time.h> const GOUNT=100; //产生100个随机数 void Random(int *r,int count) { int i; srand((unsigned)time(NULL)); for(i=0;i<count;i++) r[i]=rand()名%100000; } //打印数据 void Printdata(int *r,int count,int sort) 图 int i,s; if(sort==7||sort==8) s=1; else s=0; cout<<endI; for(i=s;i<count;i++) cout<<r[i]<<"\t"; cout<<endl; }

/****************** int main() int a[COUNT]={1},b[COUNT],SortMethod; Random(a,COUNT); //填写排序函数

/****************** cout<<endl; cout<<“排过序的数为:”; Printdata(a,COUNT,SortMethod); cout<<endI; return o; }

a[i] = rand();

//冒泡排序
<span class="hljs-type">void</span> Random(<span class="hljs-type">int</span> a[],n){
    <span class="hljs-type">int</span> i,j,<span class="hljs-keyword">temp</span>;
    <span class="hljs-keyword">for</span>(i=<span class="hljs-number">1</span>;i<n;i++)
    {
        <span class="hljs-keyword">for</span>(j=n<span class="hljs-number">-1</span>;j>=i;j<span class="hljs-comment">--)</span>
        {
            <span class="hljs-keyword">if</span>(a[j]<a[j<span class="hljs-number">-1</span>]){
                <span class="hljs-keyword">temp</span>=a[j];
                a[j]=a[j<span class="hljs-number">-1</span>];
                a[j<span class="hljs-number">-1</span>]=<span class="hljs-keyword">temp</span>;
            }
        }    
    }    
}

冒泡排序 还是快速排序。