以下文字与答案无关
提示:有些试题内容 显示不完整,文字错误 或者 答案显示错误等问题,这是由于我们在扫描录入过程中 机器识别错误导致,人工逐条矫正总有遗漏,所以恳请 广大网友理解。
小于0
C、等于0
D、等于1
">1.若有以下定义和语句, char s1[]="12345", s2[]="1234";则函数strcmp(s1,s2)的值为()。 选项:A、大于0
B、小于0
C、等于0
D、等于1
S1高于S2
B:S1低于S2
C:S1等于S2
D:S1与S2相交
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);
}
}
">4.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);
}
}
如果strcmp(s1,s2)返回的结果为0,表示字符串s1和s2不相同。
选项: A:正确 B:错误0
B:1
C:0和1都有可能
D:大于等于0.0且小于1.0的double型随机数
等于1
B:等于0
C:小于1
D:大于1
不变,大于0
B:加1,小于0
C:减1,小于0
D:加1,小于等于0
/**********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);
}
">11.第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);
}
/**********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);
}
">12.第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);
}
等于零。
B:不等于零。
C:大于零。
D:小于0。