请大哥们给找找问题出在哪??
/*有n个整数,使前面各数顺序 向后移动m个位置,最后m个数变成最前面m个数,写一函数实现以止功能,在主函数中输入n个整数和输出调整后的n个数*/
#include<stdio.h>
int main ()
{
void move(int [20],int,int);
int number[20],n,m,i;
printf("How many numbers :");
scanf_s("%d",&n);
printf("input %d numbers",n);
for(i=0;i<n;i++)
scanf_s("%d",&number[i]);
printf("how many do you want to move:");
scanf_s("%d",&m);
move(number,n,m);
printf("Now they are :\n");
for(i=0;i<n;i++)
printf(" %d ",&number[i]);
return 0;
}
void move(int aray[20],int n,int m)
{
int * p,aray_end;
aray_end=*(aray+n-1);
for(p=aray+n-1;p>aray;p--)
*p=*(p-1);
*aray=aray_end;
m--;
if(m>0)
move(aray,n,m);
}
/*
输出为:
How many numbers :8
input 8 numbers 12 43 65 67 8 2 7 11
how many do you want to move:4
Now they are :
3406224 3406228 3406232 3406236 3406240 3406244 3406248 3406252 请按任意键继续. .
???不知道哪错了最后我想要的是:
Now they are :
8 2 7 11 12 43 65 67
*/