为什么运行不了,出现Process terminated with status -1073741510 (0 minute(s), 6 second(s))
#include <stdio.h>#define N 80
void fun(int *w,int p,int n)
{
int i=0,c;
while(i<=p)
{
i=0;
c=w[i];
w[i]=w[i+1];
w[n-1-i]=c;
i+=1;
}
}
int main()
{
int a[N]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
int i,p,n=15;
printf("The original data:\n");
for(i=0;i<n;i++)
{
printf("%3d",a[i]);
}
printf("\n\nEnter p:");
scanf("%d",&p);
fun(a,p,n);
printf("\nThe data after moving:\n");
for(i=0;i<n;i++)
{
printf("%3d",a[i]);
printf("\n\n");
}
printf("Hello world!\n");
return 0;
}