下面函数的功能是( )。 sss(s,t) char*s,*t; {while((*s)&&(*t)&&(*t++==*s++)); return(*s-*t): }
A.将字符串s复制到字符串t中
B.比较两个字符串的火小
C.求字符串的长度
D.将字符书s接续到字符串t中
第1题:
以下函数的功能是将两个字符串s和t连接起来,横线部分应该填写什么语句? void conj(char *s,char *t) { char *p=s; while(*s) _______; while(*t) {*s= *t;s++;t++ } *s='0'; }
A.*s
B.s
C.s++
D.s--
第2题:
与while(*s++ = *t++ );等价的程序段是
A.do { *s = *t++; } while (*s++ );
B.while (*t ) *s++ = *t++;
C.do { *s++ = *t++; } while (*t );
D.while (*s ) *s++ = *t++;
第3题:
以下函数的功能是将两个字符串s和t连接起来,横线部分应该填写什么语句? void conj(char *s,char *t) { char *p=s; while(*s) ; while(*t) {*s= *t;s++;t++ } *s='0'; }
A.*s
B.s
C.s++
D.s--
第4题:
有以下程序
#include <stdio.h>
void fun(char *t,char *s)
{ while(*t!=0) t++;
while((*t++=*s++)!=0);
}
main( )
{ char ss[10]="acc",aa[10]="bbxxyy";
fun(ss,aa); printf("%s,%s\n",ss,aa);
}
程序的运行结果是
A.accxyy,bbxxyy
B.acc,bbxxyy
C.accxxyy,bbxxyy
D.accbbxxyy,bbxxyy
第5题:
下面函数的功能是( )。 sss(s,t) char*s,*t; {while(*s); while(*t) *(s++)=*(t++); return s; }
A.将字符串s复制到字符串t中
B.比较两个字符串的大小
C.求字符串的长度
D.将字符串t续接到字符串s中
第6题:
下面函数的功能是( ) sss(s,t) char *s,*t; { while((*s)&&(*t)&&(*t++==*s++)); return(*s- * t); }
A.求字符串的长度
B.比较两个字符串的大小
C.将字符串s复制到字符串t中
D.将字符串s接续到字符串t中
第7题:
下面函数的功能是()sss(s,t)char*s,*t;{ while((*s)&&(*t)&&(*t++==*s++));return(*s- * t); }
A.求字符串的长度
B.比较两个字符串的大小
C.将字符串s复制到字符串t中
D.将字符串s接续到字符串t中
第8题:
有以下程序 #include <stdio.h> voidfun(char*t,char*s) {while(*t!=0) t++; while((*t++=*s++)!=0); } main() {char ss[10]="acc",aa[10]="bbxxyy"; fun(ss,aa); printf("%s,%s\n",ss,aa); } 程序的运行结果是
A.accxyy,bbxxyy
B.acc,bbxxyy
C.accxxyy,bbxxyy
D.accbbxxyy,bbxxyy
第9题:
A.strcmp1(char *s, chat *t)
{ for ( ;*s++==*t++ ;)
if (*s=='\0') return 0
return (*s-*t)
}
B.strcmp2(char *s, char *t)
{ for( ;*s++==*t++ ;)
if (!*s) return0
return (*s-*t)
C.strcmp3(char *s, char *t)
{ for ( ;*t==*s ;)
{ if (!*t) return 0
t++
s++}
return (*s-*t)
}
D.strcmp4(char *s, char *t)
{ for( ;*s==*t;s++,t++)
if (!*s) return 0
return (*t-*s)
}