From 31af716c2338c50b4f52f938644caf611e4b84b1 Mon Sep 17 00:00:00 2001 From: smallkun Date: Tue, 18 Mar 2025 09:18:30 +0800 Subject: [PATCH] Auto commit --- 2207/C语言同步练习源码/5.指针-2.c | 23 +++++++++++++++++++++++ 2207/C语言同步练习答案.md | 26 ++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 2207/C语言同步练习源码/5.指针-2.c diff --git a/2207/C语言同步练习源码/5.指针-2.c b/2207/C语言同步练习源码/5.指针-2.c new file mode 100644 index 0000000..f7e4d2b --- /dev/null +++ b/2207/C语言同步练习源码/5.指针-2.c @@ -0,0 +1,23 @@ +#include +/* +1 2 3 4 5 6 7 8 9 10 +1 3 4 5 6 7 8 9 10 +*/ +int main(){ + int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + int n = 10; + int i; + int *p, *q; + p = a+1; + q = a+2; + for(i=0;i<8;i++){//ѭĴ + *p++ = *q++; + } + n--; + for(i=0;i +/* +1 2 3 4 5 6 7 8 9 10 +1 3 4 5 6 7 8 9 10 +*/ +int main(){ + int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + int n = 10; + int i; + int *p, *q; + p = a+1; + q = a+2; + for(i=0;i<8;i++){//用来控制循环的次数 + *p++ = *q++; + } + n--; + for(i=0;i