Auto commit

This commit is contained in:
smallkun 2025-03-18 09:18:30 +08:00
parent 09d0f90697
commit 31af716c23
2 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#include <stdio.h>
/*
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<n;i++){
printf("%d ", *(a+i));
}
printf("\n");
return 0;
}

View File

@ -776,6 +776,32 @@ int main(){
![image-20250227231216409](https://yp.smallkun.cn/markdown/image-20250227231216409.png!compress)
```c
#include <stdio.h>
/*
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<n;i++){
printf("%d ", *(a+i));
}
printf("\n");
return 0;
}
```
### 指针-3