#include
int mydel(int*p,int n, int k);
void myout(int *a,int n);
int main() {
int a[10]={1,2,3,4,5,6,7,8,9,10};
int n = 10,k=0;
printf("input the k number to delete\n");
scanf("%d",&k);
if (k<1 || k>10) {
printf("input number error\n");
}
myout(a,10);
n = mydel(a,n,k);
myout(a,n);
return 0;
}
int mydel(int*p,int n, int k) {
if (k>n || k<1) return n;
p=p+k;
int c = n-k;
while(c--> 0) *(p-1) = *p++;
return --n;
}
void myout(int *a,int n) {
int i=0;
for (;i
}