24 lines
315 B
C
24 lines
315 B
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;
|
|
}
|
|
|