题目内容

有以下程序,其中函数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);}程序运行后的输出结果是____________。

有以下程序:#includefloatf1(floatn){returnn*n;}floatf2(floatn){return2*n;}main(){float(*p1)(float),(*p2)(float),(*t)(float),y1,y2;p1=f1;p2=f2;y1=p2(p1(2.0));t=p1;p1=p2;p2=t;y2=p2(p1(2.0));printf("%.0f,%.0f\n",y1,y2);}程序运行后的输出结果是____________。

答案查题题库