From b5cc50f90d46cbfea1e3ebd64e60cf5bc8eaebe1 Mon Sep 17 00:00:00 2001 From: smallkun Date: Tue, 1 Apr 2025 16:38:21 +0800 Subject: [PATCH] Auto commit --- 万维调考试题源码/4-2.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/万维调考试题源码/4-2.c b/万维调考试题源码/4-2.c index 3485462..10ae444 100644 --- a/万维调考试题源码/4-2.c +++ b/万维调考试题源码/4-2.c @@ -31,6 +31,14 @@ void sort(int *p, int n) { int i, j, temp; /**********Program**********/ - + i = 0; + j = n-1; + while(i < j){ + temp = p[i]; + p[i] = p[j]; + p[j] = temp; + i++; + j--; + } /********** End **********/ -} \ No newline at end of file +}