From 7c42adee6623f331760e04775aa91570ffc6e10e Mon Sep 17 00:00:00 2001 From: hehe Date: Sat, 7 Feb 2026 02:57:08 -0500 Subject: [PATCH] =?UTF-8?q?=E9=95=87=E4=B9=83=E5=A4=A9=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 188.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 188.cpp 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<