diff --git a/188.cpp b/188.cpp new file mode 100644 index 0000000..ad974eb --- /dev/null +++ b/188.cpp @@ -0,0 +1,39 @@ +#include +using namespace std; +int main(){ + int a[5]; + int max; + bool bl=true; + cout<<"请输入5个整数"<>a[i]; + } + for(int i=0;i<5;i++) + { + for(int j=0;j<4-i;j++) + { + if(a[j]>a[j+1]) + { + max=a[j]; + a[j]=a[j+1]; + a[j+1]=max; + bl=false; + } + if(!bl) + break; + } + + + for(int n=0;n<5;n++) { + + cout<