From 700a1464126c37f7bca5d2acf563dcb031a53449 Mon Sep 17 00:00:00 2001 From: patvgnw5f <483018233@qq.com> Date: Thu, 17 Feb 2022 17:04:42 +0800 Subject: [PATCH] =?UTF-8?q?Add=20=E5=86=92=E6=B3=A1=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 冒泡排序 | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 冒泡排序 diff --git a/冒泡排序 b/冒泡排序 new file mode 100644 index 0000000..ff21fa1 --- /dev/null +++ b/冒泡排序 @@ -0,0 +1,28 @@ + +#include +int main(void) +{ + int a[1001]; + int n,i,j,t; + scanf("%d",&n); + for(i=0;ia[j+1])//每次冒泡,进行交换 + { + t=a[j]; + a[j]=a[j+1]; + a[j+1]=t; + } + } + for(j=0;j