有以下字符串,说明表达式strlen(s)值的是( )。char s[10]={'a','\n','a','b','\t','c'};A)10B)1C)6D)7
有以下字符串,说明表达式strlen(s)值的是( )。
char s[10]={'a','\n','a','b','\t','c'};
A)10
B)1
C)6
D)7
相关考题:
有以下程序#include stdio.h#include string.hvoid fun(char s[][10],int n){ char t;int i,j;for(i=0;in-1;i++)for(j=i+1;jn;j++)/* 比较字符串的首字符大小,并交换字符串的首字符 */if (s[i][0] s[j][0]) {t=s[i][0];s[i][0]=s[j][0];s[j][0]=t;}}main(){ char ss[5][10]={"bcc","bbcc","xy","aaaacc","aabcc"};fun(ss,5); printf("%s,%s\n",ss[0],ss[4]);}程序运行结果是A)xy,aaaaccB)aaaacc,xyC) xcc,aabccD) acc,xabcc
下面程序的功能是从输入的十个字符串中找出最长的那个串。请在________处填空。#include "stdio.h"#include "string.h"#define N 10main(){char s[N][81], * tint jfor (j=0 jgets (s[j])t= *sfor (j=1 jif(strlen(t)printf("the max length of ten strings is: %d, %s\n", strlen(t), t)}A.t=s[j]B.t=&s[j]C.t= s++D.t=s[j][0]
有以下程序:includeincludevoid fun(char s[][10],int n){char t;int i,j; 有以下程序: #include<stdio.h> #include<string.h> void fun(char s[][10],int n) { char t;int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) /*比较字符串的首字符大小,并交换字符串的首字符*/ if(s[i][0]>s[j][0]){t=s[i][0];s[i][0]=s[j][0];sEj][0]=t;} } main() {char s[5][10]={"bcc","bbcc","xy","aaaacc","aabcc"); fun(ss,5);printf("%s,%s\n",ss[0],ss[4]); } 程序的运行结果是( )。A.xy,aaaaccB.aaaacc,xyC.xcc,aabccD.acc,xabcc
以下程序段中,不能正确赋字符串(编译时系统会提示错误)的是( )。A.char s[10]=="abcdefg";B.char t[]="abcdefg",*s=t;C.char s[10];s="abcdefg";D.char s[10];strcpy(s,"abcdefg");
有以下程序:includeincludeincludevoid f(char*s,char*t){char k;k=*s; * 有以下程序: #include<stdio.h> #include<string.h> #include void f(char*s,char*t) { char k; k=*s; *s=*t; *t=k; s++;t--; if(*s)f(s,t): } main() {char str[10]="abcdefg",*P; P=str+strlen(str)/2+1: f(p,p-2); printf("%s\n",str); } 程序运行后的输出结果是( )。A.abcdefgB.gfedcbaC.gbcdefaD.abedcfg
有以下程序#include stdio.h#include string.hvoid fun(char *s[],int n){ char *t; int i,j;for(i=0;in-1;i++)for(j=i+1;jn;j++)if(strlen(s[i])strlen(s[j])) {t=s[i];s[i]:s[j];s[j]=t;}}main(){ char *ss[]={"bcc","bbcc","xy","aaaacc","aabcc"};fun(ss,5); printf("%s,%s\n",ss[0],ss[4]);}程序的运行结果是A.xy,aaaaccB.aaaacc,xyC.bcc,aabccD.aabcc,bcc
有以下程序main(){ char s[]="\n123\\";printf("%d,%d\n",strlen(s),sizeof(s));}执行后输出结果是A.赋初值的字符串有错B.6,7C.5,6D.6,6
有以下程序:includevoid f(char *s, char *t){ char k;k=*s;*s=*t; *t=k;s++;t- -; 有以下程序:#include <string .h>void f(char *s, char *t){ char k; k=*s; *s=*t; *t=k; s++; t- -; if(*s) f(s, t);}main(){ char str[10]="abcdefg",*p; p=str+strlen(str)/2+ 1; f(p,p-2); printf("%s\n", str);}程序运行后的输出结果是( )。A.abcdcfgB.gfedcbaC.gbcdefaD.abedcfg
有以下等程序include void f(char *s, char *t){ chark; k=*s; *s=*t; *t=k; s++;t- 有以下等程序#include <string. h>void f(char *s, char *t){ char k; k=*s; *s=*t; *t=k; s++; t--; if(*s) f(s, t);}main (){ char stt[10] ="abcdefg", *p; p=str+strlen (str)/2+1; f (p,p-2); print f ( "%s\n", str);}A.abcdefgB.gfedcbaC.gbcdefaD.abedcfg
有以下程序并includeincludefun(char * w,int n){char t,*s1,*s2; s1=w;s2= 有以下程序 并include<stdio.h> #include<string.h> fun(char * w,int n) { char t,*s1,*s2; s1=w; s2=w+n-1; while(s1<s2) { t=*s1++; * s1=*s2--; * s2=t; } } main() { char p[]="1234567"; fun(p,strlen(p)); puts(p); } 程序运行后的输出结果是( )A.1234567B.7654321C.1711717D.7177171
有以下程序:includevoid f(char*s,char*t){ char k;k=*s;*s=*t;*t=k;s++;t--;if(*s)f 有以下程序: #include<string.h> void f(char*s,char*t) { char k; k=*s; *s=*t; *t=k; s++; t--; if(*s) f(s,t); } main( ) {char str[10]="abcdefg",*p; p=str+strlen(str)/2+1; f(p,p-2); printf(~%s\n",str); } 程序运行后的输出结果是 ______。A.abcdefB.gfedcbaC.gbcdefaD.abedcfg
若有以下定义: char s(10)="program",t[]="test"; 则下列选项中对字符串操作错误的是( )。A.strcpy(s,t);B.strcat(s,t);C.cout<<strlen(s);D.gets(s);
有以下程序 include include void fun(char s[][10],int n 有以下程序 #include <stdio.h> #include <string.h> void fun(char s[][10],int n) { char t; int i j; for (i=0; i<n-1; i++) for 0--i+l; j<n; j++) /*比较字符串的首字符大小,并交换字符串的首字符*/ if(s[i][0] > s[j][0]) { t = s[i][0]; s[i][0] = s[j][0]; s[j][0] = t;} } main() { char ss[5][10]= {"bcc", "bbcc", "xy", "aaaacc", "aabcc" }; fun(ss, 5); printf("%s,%s\n", ss[0],ss[4]); } 程序的运行结果是A.xy, aaaaccB.aaaacc,xyC.xcc,aabccD.acc,xabcc
有以下程序: include void f(char *s,char *t) {char k; k=*s; +s=*t; 有以下程序: #include<string.h> void f(char *s,char *t) {char k; k=*s; +s=*t; *t=k; S++; t--; if(*s) f(s,t); } main() {char.str[10]="abcdefg",*p; p=str+strlen(str) /2+1; f(p,p-2); printf("%s\n",str); } 程序运行后的输出结果是 ______。A.abcdefgB.gfedcbaC.gbcdefaD.abedcfg
以下程序的输出结果是______。includeincludefun(char*w,int n){ char t,*s 以下程序的输出结果是______。 #include<stdio.h> #include<string.h> fun(char*w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) { t=*s1++; *s1=*s2-; *s2=t; } } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }A.1234567B.7654321C.1711717D.7177171
有以下程序:includeincludevoid fun(char*s[],int n){char*t;int i,j;for( 有以下程序: #include<stdio.h> #include<string.h> void fun(char*s[],int n) { char*t;int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strlen(s[i])>strlen(s[j])){t=s[i];s[i]=s[j];s[j]=t;} } main() { Char*ss[]={"bcc","bbcc","xy","aaaacc","aabcc"}; fun(ss,5);printf("%s,%s\n",ss[0],ss[4]); } 程序的运行结果是( )。A.xy,aaaaccB.aaaacc,xyC.bcc,aabccD.aabcc,bcc
有以下程序includeincludevoidfun(char*s[],intn){char*t;int i,j;for(i=0 有以下程序 #include <stdio.h> #include <string.h> void fun(char *s[],int n) { char *t; int i,j; for(i=0;i<n-1;++) for(j=i+1;j<n;j++) if(strlen(s[i])>strlen(s[j])) {t=s[i];s[i];s[j];s[j]=t;} } main() { char *ss[]={"bccA.xy,aaaaccB.aaaacc,xyC.bcc,aabccD.aabcc,bcc
以下程序的输出结果是______。includeincludefun(char *w,int n){ char t,* 以下程序的输出结果是______。 #include<stdio.h> #include<siring.h> fun(char *w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) { t=*s1++; *s1=*s2-; *s2=t; } } main() { char *p; p="1234567"; fun(p,strlen(p)); puts(p); }A.1234567B.7654321C.1711717D.7177171
若有以下定义和语句char s1[10]=”aBcd!”,*s2=”\n123\\”printF(“%d%d\n”,strlen(sl),strlen(s2));则输出结果是A.5 5B.10 5C.10 7D.5 8
以下程序的输出结果是_______。includeincludefun(char*w,int n){char t,*s 以下程序的输出结果是_______。 #include<stdio.h> #include<string.h> fun(char*w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) { t=*s1++: *sl=*s2-; *s2=t; } } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }A.1234567B.7654321C.1711717D.7177171
有以下程序: include include void f(char * s,char*t){char k; k=*s;*s=* 有以下程序: #include <stdio.h>#include <string.h>void f(char * s,char*t){ char k; k=*s; *s=*t; *t=k; s++; t--; if( * s) f(s,t);}main( ){ char str[10] :"abedefg", * p; p = str + strlen(str)/2+1; f(p,p -2); printf( "% s \n" ,str);程序运行后的输出结果是( )。A.abcdefgB.gfedcbaC.gbcdefaD.abedcfg
有以下程序includeincludevoidfun(char,*s[],intn){char*t;inti,j; for(i= 有以下程序 #include <stdio.h> #include <string.h> void fun(char,*s[],int n) { char *t; int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strlen(s[i])>strlen(s[j])) {t=s[i];s[i]:s[j];s[j]=t;} } main() { char *ss[]={"bcc","bbcc","xy","aaaacc","aabcc"}; fun(ss,5); printf("%s,%s\n",ss[0],ss[4]); } 程序的运行结果是A.xy,aaaaccB.aaaacc,xyC.bcc,aabccD.aabcc,bcc
有以下程序#include stdio.h#include string.hvoid fun(char s[][10],int n){char t; int i,j;for(i=0;in-1;i++)for(j=i+1;jn;j++)/*比较字符串的首字符大小 ,并交换字符串的首字符*/if(s[i][0]s[j][0]) {t=s[i][0];s[i][0]=s[j][0];s[j][0]=t;}}main(){char ss[5][10]={“bcc”,”bbcc”,”xy”,”aaaacc”,”aabcc”};fun(ss,5); printf(“%s,%s\n”,ss[0],ss[4]);}程序的运行结果是( )。A.xy,aaaaccB.aaaacc,xyC.xcc,aabccD.acc,xabcc
( 31 )若有以下定义和语句char s1[10]= " abcd! " ,*s2= " \n123\\ ";printf ( " %d %d\n ", strlen ( s1 ) ,strlen ( s2 ) ) ;则输出结果是A ) 5 5B ) 10 5C ) 10 7D ) 5 8
单选题有以下程序:#include #include void fun(char *s[],int n){ char *t; int i,j; for(i=0;i for(j=i+1;j if(strlen(s[i])strlen(s[j])) { t=s[i]; s[i]=s[j]; s[j]=t; }}main(){ char *ss[]={"bcc","bbcc","xy","aaaacc","aabcc"}; fun(ss,5); printf("%s,%s",ss[0],ss[4]);}程序的运行结果是( )。Axy,aaaaccBaaaacc,xyCbcc,aabccDaabcc,bcc