题目内容 (请给出正确答案)
[单选题]

以下程序中函数f的功能是将n个字符串按由大到小的顺序进行排序: #include <string.h> void f(char p[][10],int n) { char t[20]; int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++ if(strcmp(p[i],p[j])<0) { strcpy(t,p[i]);strcpy(p[i],p[j]);strcpy(p[j],t); } } main() {char p[][10]:{"abc","aabdfg","abbd","dcdbe","cd",);int i; f(p,5); printf("%d\n",strlen(p[0])); } 程序运行后的输出结果是()。

A.6

B.4

C.5

D.3

查看答案
如搜索结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能会需要:
您的账号:
发送账号密码至手机
发送
更多“以下程序中函数f的功能是将n个字符串按由大到小的顺序进行排序…”相关的问题

第1题

以下程序中函数f的功能是将n个字符串按由大到小的顺序进行排序。#include<string. h>void f(char

以下程序中函数f的功能是将n个字符串按由大到小的顺序进行排序。#include <string. h>void f(char p[][10],int n){ chart[20];int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n; j++) if(strcmp(p[i],p[j]<0) {strcpy(t, p[i]); strcpy(p[i],p[j]);strcpy(p[j],t);}}main(){ char p[][10]={"abc", "aabdfg", "abbd", "dcdbe", "cd"}; int i; f(p,5); printf("%d\n", strlen(p[0]));} 程序运行后的输出结果是()。

A.6

B.4

C.5

D.3

点击查看答案

第2题

以下程序中函数f的功能是将n个字符串按由大到小的顺序进行排序。 #include<string.h> void f(char

以下程序中函数f的功能是将n个字符串按由大到小的顺序进行排序。 #include <string.h> void f(char p[][10], int n) { char t[20]; int i,j; for(i=0;i<n-1;i++) for(j=i+l;j<n;j++) if(strcmp (p[i],p[j])<0) { strcpy(t,p[i]);strcpy(p[i],p[j]);strcpy(p[j],t);} } main() { char p[][lO]-{"abc","aabdfg","abbd","dcdbe","cd"};int i; f(p,5); printf("%dkn",strlen(p[0])); } 程序运{亍后的输出结果是

A.6

B.4

C.5

D.3

点击查看答案

第3题

以下程序中函数f()的功能是将n个字符串按由大到小的顺序进行排序。 #include<string.h> void f(char p[ ][10],int n) { char t[20]; int i,j; for(i =O;i <n-1 ;i ++ ) for(j =i + 1 ;j < n;j ++ ) if(strcmp(p [i] ,p[j] ) <0) { strcpy(t,p[i]);strcpy(p[i] ,p[j] );strcpy(p[j] ,t); } } main () { char p [ ] [ 10 ] = { "abc","aabdfg","abbd","dcdbe", "cd" }; int i; f(p,5); printf("%d\n",strlen(p[O] ) ); } 程序运行后的输出结果是

A.6

B.4

C.5

D.3

点击查看答案

第4题

以下程序中函数f的功能是将n个字符串按由大到小的顺序进行排序。 #include<string.h> void f(char p[][10],int n) { char t[20];int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strcmp(p[i],p[j]<0) {strcpy(t,p[i]);strcpy(p[i],p[j]);strcpy(p[j],t);} } main() { charp[][10]={“abc”,“aabdfg”,“abbd”,“dcdbe”,”cd”};int i; f(p,5);printf(“%d\n”,strlen(P[0])); } 程序运行后的输出结果是

A.6

B.4

C.5

D.3

点击查看答案

第5题

有以下程序,其中函数f的功能是将多个字符串按字典顺序排序()。
有以下程序,其中函数f的功能是将多个字符串按字典顺序排序()。 A.2B.3C.6D.4请帮忙给出正

A.2

B.3

C.6

D.4

点击查看答案

第6题

有以下程序,其中函数f的功能是将多个字符串按字典顺序排序: #include<string.h> void f(ch

有以下程序,其中函数f的功能是将多个字符串按字典顺序排序: #include<string.h> void f(char *p[],int n) {char *t;int i,j; for(i=O;i<n-1;i++) for(j=i+1;j<n;j++) if strcmp(p[i],p[j])>0{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])); } 程序运行后的输出结果是 ______。

A.2

B.3

C.6

D.4

点击查看答案

第7题

有以下程序,其中函数f的功能是将多个字符串按字典顺序排序()。 #include<string.h> void f

有以下程序,其中函数f的功能是将多个字符串按字典顺序排序()。 #include<string.h> void f(char*p[],int n) { char*t;int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strcmp(p[i],p[j]>0){t=p[i];p[i]=p[j];p[j] =t;} } main { char *P[5]={"abe","aabdfg","abbd","dcd- be","cd"}; f(p,5); printf("%d\n",strlen(p[1])); } 程序运行后的输出结果是()o

A.2

B.3

C.6

D.4

点击查看答案

第8题

有以下程序,其中函数f的功能是将多个字符串按字典顺序排序()。#include<string.h>void f(c

有以下程序,其中函数f的功能是将多个字符串按字典顺序排序()。

#include<string.h>

void f(char*p[],int n)

{ char*t;int i,j;

for(i=0;i<n-1;i++)

for(j=i+1;j<n;j++)

if(strcmp(p[i],p[j]>0){t=p[i];p[i]=p[j];p[j]

=t;}

}

main

{ char *P[5]={"abe","aabdfg","abbd","dcd-

be","cd"};

f(p,5);

printf("%d\n",strlen(p[1]));

}

程序运行后的输出结果是()o

A.2

B.3

C.6

D.4

点击查看答案

第9题

有以下程序,其中函数f的功能是将多个字符串按字典顺序排序#includestring.hvoidf(char*p[],int

有以下程序,其中函数f的功能是将多个字符串按字典顺序排序#includestring.hvoidf(char*p[],intn){char*t;inti,j;for(i=0;in-1;i++)for(j=i+1;jn;j++)if(strcmp(p[i],p[j])0){t=p[i];p[i]=p[j];p[j]=t;}}main(){char*p[5]={“abc”,“aabdfg”,“abbd”,“dcdbe”,“cd”}。

:A.2

B.3

C.6

D.4

点击查看答案
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
温馨提示
每个试题只能免费做一次,如需多次做题,请购买搜题卡
立即购买
稍后再说
警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“赏学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
赏学吧
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反赏学吧购买须知被冻结。您可在“赏学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
赏学吧
点击打开微信