From aa793c62eccfc14ccd2f573f51b9369d5da705cd Mon Sep 17 00:00:00 2001 From: pos2gra5i <2949973001@qq.com> Date: Fri, 18 Feb 2022 10:04:40 +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 --- 冒泡排序 | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 冒泡排序 diff --git a/冒泡排序 b/冒泡排序 new file mode 100644 index 0000000..e2d61da --- /dev/null +++ b/冒泡排序 @@ -0,0 +1,34 @@ +//冒泡排序 +#include +void bubbleSort(int a[],int n) +{ + int temp; + for(int i=0;ia[j+1]) + { + temp=a[j]; + a[j]=a[j+1]; + a[j+1]=temp; + } + } + } +} +int main() +{ + int a[1000]; + int n; + scanf("%d",&n); + for(int i=0;i