diff --git a/选择法.cpp b/选择法.cpp new file mode 100644 index 0000000..0a45704 --- /dev/null +++ b/选择法.cpp @@ -0,0 +1,19 @@ +void choise(int *a,int n) +{ + int i,j,min,temp; + for(i=0;ia[j]) + min=j; + } + if(i!=min) + { + temp=a[i]; + a[i]=a[min]; + a[min]=temp; + } + } +}