diff --git a/排序/maopaopaixu.cpp b/排序/maopaopaixu.cpp new file mode 100644 index 0000000..ca52c2f --- /dev/null +++ b/排序/maopaopaixu.cpp @@ -0,0 +1,36 @@ +#include +#include +using namespace std; +int main(){ + + int n=5,max; + bool bl=false; + int a[n]={12,22,81,94,95}; + + for(int i=0;ia[j+1]){ + + max=a[j]; + a[j]= a[j+1]; + a[j+1]=max; + + bl=true; + } + if (!bl) + break; + + } + + + } + for(int j=0;j