524.#include<iostream>
525.using namespace std;
526.int main()
527.{void select_sort(int array[],int n);
528.int a[10],i;
529.cout<<"请输入10个数:"<<endl;
530.for(i=0;i<10;i++)
531.cin>>a[i];
532.cout<<endl;
533.select_sort(a,10);
534.cout<<"请输出10个数:"<<endl;
535.for(i=0;i<10;i++)
536.cout<<a[i]<<" ";
537.cout<<endl;
538.return 0;
539.}
540.void select_sort(int array[],int n)
541.{int k,t;
542.for(k=1;k<=9;k++)
543.for(n=0;n<10-k;n++)
544.if(array[n]>array[n+1])
545.{t=array[n];array[n]=array[n+1];array[n+1]=t;}
546.}
525.using namespace std;
526.int main()
527.{void select_sort(int array[],int n);
528.int a[10],i;
529.cout<<"请输入10个数:"<<endl;
530.for(i=0;i<10;i++)
531.cin>>a[i];
532.cout<<endl;
533.select_sort(a,10);
534.cout<<"请输出10个数:"<<endl;
535.for(i=0;i<10;i++)
536.cout<<a[i]<<" ";
537.cout<<endl;
538.return 0;
539.}
540.void select_sort(int array[],int n)
541.{int k,t;
542.for(k=1;k<=9;k++)
543.for(n=0;n<10-k;n++)
544.if(array[n]>array[n+1])
545.{t=array[n];array[n]=array[n+1];array[n+1]=t;}
546.}