选择题:●试题二 阅读下列函数说明和C函数,将应填入(n)处的字句写在答题纸的对应栏内。 【函数2.1说明】

  • 题目分类:软考初级
  • 题目类型:选择题
  • 号外号外:注册会员即送体验阅读点!
题目内容:
●试题二

阅读下列函数说明和C函数,将应填入(n)处的字句写在答题纸的对应栏内。

【函数2.1说明】

函数palindrome(char s[])的功能是,判断字符串s是否为回文字符串,若是,则返回0,否则返回-1。若一个字符串顺读和倒读都一样时,称该字符串是回文字符串,例如:"LEVEL"是回文字符串,而"LEVAL"不是。

【函数2.1】

int palindrome(char s[])

{char*pi,*pj;

pi=s;pj=s+strlen(s)-1;

while(pi<pj && (1) ){

pi++;pj--;

}

if( (2) )return -1;

else return 0;

}

【函数2.2说明】

函数f(char*str,char del)的功能是:将非空字符串str分割成若干个子字符串并输出,del表示分割时的标志字符。

例如若str的值为"33123333435",del的值为"3",调用此函数后,将输出3个子字符串,分别为"12"、"4"和"5"。

【函数2.2】

void f(char*str,char del)

{int i ,j ,len;

len=strlen(str);

i=0;

while(i<len){

while( (3) )i++;/*忽略连续的标志字符*/

/*寻找从str[i]开始直到标志字符出现的一个子字符串*/

j=i+1;

while(str[j]!=del && str[j]!=′\0′)j++;

(4) =′\0′;/*给找到的字符序列置字符串结束标志*/

printf(″%s\t″,&str[i]);

(5) ;

}

}




参考答案:

●If your diskette has been (69) ,the computer can not store any new information on it.(69)

●If your diskette has been (69) ,the computer can not store any new information on it.(69)

查看答案

●A word processor enables you to create a (70) ,store it electronically on a disk,display

●A word processor enables you to create a (70) ,store it electronically on a disk,display

查看答案

●试题三 阅读下列函数说明和C代码,将应填入(n)处的字句写在答题纸的对应栏内。 【说明】 设有一

●试题三 阅读下列函数说明和C代码,将应填入(n)处的字句写在答题纸的对应栏内。 【说明】 设有一

查看答案

●A highlevel language is an artificial language with which we can write various (71) .(71

●A highlevel language is an artificial language with which we can write various (71) .(71

查看答案

●A user interface can be defined as the combination of hardware and software that helps pe

●A user interface can be defined as the combination of hardware and software that helps pe

查看答案