From 72af0dedf9e18911da65b9a5c4906689e868d9fc Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Mon, 8 Jun 2026 17:10:31 +0800 Subject: [legacy] Add functional and performance test suites --- rcc-legacy/tests/upload/insert_sort.sy | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 rcc-legacy/tests/upload/insert_sort.sy (limited to 'rcc-legacy/tests/upload/insert_sort.sy') diff --git a/rcc-legacy/tests/upload/insert_sort.sy b/rcc-legacy/tests/upload/insert_sort.sy new file mode 100644 index 0000000..277d6a7 --- /dev/null +++ b/rcc-legacy/tests/upload/insert_sort.sy @@ -0,0 +1,37 @@ +int a[1000]; + +/* 插入排序 */ +void InsertSort(int a[],int n) +{ + int p; + int i; + int tmp; + + p =1; + while(p=1&&a[i-1]>tmp){ + a[i]=a[i-1];/*依次与已排序序列中元素比较并右移*/ + i=i-1; + } + a[i]=tmp;/*放进合适的位置 */ + p=p+1; + } +} + +int main() +{ + int size; + int i; + size = getint(); + i = 0; + while(i