3、canf("%d%d",&a,&b);pa=&a;/*指针pa指向整数a*/pb=&b;/*指针pb指向整数b*/swap(pa,pb);/*调用函数swap,实参为指针*/printf("a=%d,b=%d",a,b);}voidswap(int*p1,int*p2)/*定义函数swap,完成交换功能*/{intt;t=*p1;/*完成交换功能*/*p1=*p2;*p2=t;}3.第三题的参考源代码如下:#include"stdio.h"voidmain(){intsum(inta,intb,intc);voidswap(inta,intb);inta,b,c
4、,(*p)();int*aa,*bb;printf("请输入2个数a,b");scanf("%d,%d",&a,&b);p=sum;c=(*p)(a,b,c);p=swap;aa=&a;bb=&b;(*p)(aa,bb);printf("sum=%d",c);printf("a=%d,b=%d",a,b);}intsum(inta,intb,intc){c=a+b;return(c);}voidswap(int*aa,int*bb){intt;t=*aa;*aa=*bb;*bb=t;}4.第四题的参考源代码如下:#include"stdio.h"void
5、main(){voidpai(int*p,inta);inta[10],i;printf("请输入10个数");for(i=0;i<10;i++)scanf("%d",&a[i]);pai(a,10);for(i=0;i<10;i++)printf("%d",a[i]);}voidpai(int*p,intn){inti,x[10],j,k,t;for(i=0;i<10;i++)x[i]=*(p+i);for(i=0;ix[j])k=j;if(k!=i){t=x[k];x[k]=x[
6、i];x[i]=t;}}for(i=0;i7、char*p2){ints=0;for(;*p1!=' ';p1++,p2++){if(*p1==*p2)continue;elseif(*p1!=*p2)s=*p1-*p2;}return(s);}6.第六题的参考源代码如下:#include"stdio.h"voidmain(){voidzhuan(int(*p)[4],inta,intb);inta[4][4],i,j;printf("请输入数组a[4][4]");for(i=0;i<4;i++)for(j=0;j<4;j++)scanf("%d",&a[i][j]);zhuan(a,4,4);}vo