以下文字与答案无关
提示:有些试题内容 显示不完整,文字错误 或者 答案显示错误等问题,这是由于我们在扫描录入过程中 机器识别错误导致,人工逐条矫正总有遗漏,所以恳请 广大网友理解。
}
若运行时依次输入:abcd、abba和abc三个字符串,则输出结果为________。
选项: A:A、abc B:B、abcd C:C、abca D:D、abba">6.以下程序中函数scmp的功能是返回形参指针s1和s2所指字符串中较小字符串的首地址#include<stdio.h>
#include<string.h>
char *scmp(char*s1,char*s2)
{
if(strcmp(s1,s2)<0)
return(s1);
else return(s2);
}
void main()
{
int i;
char string20],str3]20];
for(i=0;i<3;i++)
gets(stri]);
strcpy(string,scmp(str0],str1]));
/*库函数strcpy对字符串进行复制*/
strcpy(string,scmp(string,str2]));
printf("%s\n",string);
}
若运行时依次输入:abcd、abba和abc三个字符串,则输出结果为________。
选项: A:A、abc B:B、abcd C:C、abca D:D、abba如果strcmp(s1,s2)返回的结果为0,表示字符串s1和s2不相同。
选项: A:正确 B:错误s2 = new String();
s2 = "study hard.";
System.out.print(s1);
System.out.println(s2);
s2 = "learn english, too";
System.out.print(s1);
System.out.println(s2);
s2 = s1 + s2;
System.out.println(s2);
}
}
">10.6.阅读程序,写出运行结果public class StringUse {
public static void main(String] args) {
String s1, s2;
s1 = new String("Students should ");
s2 = new String();
s2 = "study hard.";
System.out.print(s1);
System.out.println(s2);
s2 = "learn english, too";
System.out.print(s1);
System.out.println(s2);
s2 = s1 + s2;
System.out.println(s2);
}
}
#include<string.h>
Struct STU
{ int num;
Float TotalScore;};
Void f(struct STU p)
{ struct STU s2]={{20044,550},{20045,537}};
P.num=s1].num;p.TotalScore=s1].TotalScore;}
Main()
{ struct STU s2]={{20041,703},{20042,580}};
F(s0]);
Printf(''%d %3.0f\n'',s0].num,s0].TotalScore,);}
程序运行后的输出结果是( )。
选项: A:20045 537
B:20044 550
C:20042 580
D:20041 703
/**********found**********/
if (find==__3__) printf("\nDon't found!\n");
}
main()
{ char xN]M]={"BASIC","C langwage","Java","QBASIC","Access"},strM];
int i;
printf("\nThe original string\n\n");
for(i=0;i<N;i++)puts(xi]); printf("\n");
printf("\nEnter a string for search : "); gets(str);
fun(x,str);
}
">18.第22套程序填空题
所属年份:2010.9;2011.3;
下列给定程序中,函数fun的功能是:在形参ss所指字符串数组中,查找含有形参substr所指子串的所有字符串,并输出,若没找到则输出相应信息。ss所指字符串数组中共有N个字符串,且串长小于M。程序中库函数strstr(s1,s2)的功能是在s1串中查找s2子串,若没有,函数值为0,若有,函数值为非0。
请在下画线处填入正确的内容并将下画线删除,使程序得出正确的结果。
注意:部分源程序在文件BLANK1.C中。
不得增行或删行,也不得更改程序的结构!
#include <stdio.h>
#include <string.h>
#define N 5
#define M 15
void fun(char (*ss)M], char *substr)
{ int i,find=0;
/**********found**********/
for(i=0; i< __1__ ; i++)
/**********found**********/
if( strstr(ssi], __2__) != NULL )
{ find=1; puts(ssi]); printf("\n"); }
/**********found**********/
if (find==__3__) printf("\nDon't found!\n");
}
main()
{ char xN]M]={"BASIC","C langwage","Java","QBASIC","Access"},strM];
int i;
printf("\nThe original string\n\n");
for(i=0;i<N;i++)puts(xi]); printf("\n");
printf("\nEnter a string for search : "); gets(str);
fun(x,str);
}