调试没错,但是在链接就出错#include <stdio.h>int i,e,a[];int *begin,*end;int make(int a[]){int b,e=0;printf("请输入数组的值,以0结束");scanf("%d",&b);if(b){a[e]=b;e++;}return e;}void left(){int * begin,* end,*b,i;int p,q;q=e-1;begin=a;*end=a[e];printf("请输入右移的位数");scanf("%d",&p);for(p;p>0;p--){begin=end;*end=a[q];q=q-1;}b=begin;for(i=0;i<=e;i++){a[i]=*b;b++;}}void xian(){for(i=0;i<=e;i++){printf("%d",a[i]);}}int main(){int c[15];make(c);left();return 0;}
添加回答
举报
0/150
提交
取消