#include<iostream>
#include<time.h>
using namespace std;
void SelectionSortFec(int a[],int i,int n);
int main()
{
int a[11];
srand((unsigned int(time(NULL))));//导入时间种子加每次运行结样试下伪随机数种子
for (int i=0;i<11;i++)
a[i]=rand();
SelectionSortFec(a,0,11);
for(int i=0;i<11;i++)
cout<<a[i]<<endl;
return 0;
}
void SelectionSortFec(int a[],int i,int n)
{
if(i<n)
{
int temp=i,j=i+1;
while(j<n)
if(a[temp]<a[j++])
temp=j-1;
if(temp!=i)
{
j=a[i];
a[i]=a[temp];
a[temp]=j;
}
SelectionSortFec(a,i+1,n);
}
}