题目内容

有以下程序:#includevoidswap1(intc0[],intc1[]){intt;t=c0[0];c0[0]=c1[0];c1[0]=t;}voidswap2(int*c0,int*c1){intt;t=*c0;*c0=*c1;*c1=t;}main(){inta[2]={3,5},b[2]={3,5};swap1(a,a+1);swap2(&b[0],&b[1]);printf("%d%d%d%d\n",a[0],a[1],b[0],b[1]);}程序运行后的输出结果是____________。

查看答案
更多问题

有以下程序,其中函数f的功能是将多少字符串按字典顺序排序。#include#includevoidf(char*p[],intn){char*t;inti,j;for(i=0;i0){t=p[i];p[i]=p[j];p[j]=t;}}main(){char*p[5]={"abc","aabdfg","abbd","dcdbe","cd"};f(p,5);printf("%d\n",strlen(p[1]));}程序运行后的输出结果是____________。

有以下程序:#include#includemain(){char*p,*q;p=(char*)malloc(sizeof(char)*20);p=q;scanf("%s%s",p,q);printf("%s%s\n",p,q);}若从键盘输入:abcdef(回车),则输出结果是____________。

有以下程序:#includemain(){char*s[]={"one","two","three"},*p;p=s[1];printf("%c,%s\n",*(p+1),s[0]);}执行后输出结果是____________。

有以下程序:#include#includevoidf(char*s,char*t){chark;k=*s;*s=*t;*t=k;s++;t--;if(*s)f(s,t);}main(){charstr[10]="abcde",*p;p=str+strlen(str)/2+1;f(p,p-2);printf("%s\n",str);}程序运行后的输出结果是____________。

答案查题题库