单选题String date="Today is Sunday.";String str2=data.CharAt(s.length( )-1);则str2为()AyB.CnullDfalse
单选题
String date="Today is Sunday.";String str2=data.CharAt(s.length( )-1);则str2为()
A
y
B
.
C
null
D
false
参考解析
解析:
暂无解析
相关考题:
假定有以下函数过程: Function Fun(S As String) As String Dim sl As String For i=1 To Len(S) s1=UCase (Mid(S,i,1))+s1 Next i Fun=s1 End Function则Str2=Fun("abcdefg”)的输出结果为( )。A.abcdefgB.ABCDEFGC.gfedcbaD.GFEDCBA
设有语句:char str1[]="string",str2[8],*str3,*str4="string";,则下列对库函数strcpy调用不正确的是A.strcpy(str1,"Hello1");B.strcpy(str2,"Hello2");C.strcpy(str3,"Hello3");D.strcpy(str4,"Hell04");
设有以下语句: char str1[]="string",str2[8],*str3,*str4=="string; 则______不是对库函数的正确调用。A.strcpy(str1,"HELLO1");B.strcpy(str2,"HELLO2");C.strcpy(str3,"HELLO3");D.strcpy(str4,"HELLO4")
请补充函数fun(),该函数的功能是:把从主函数中输入的字符串str2接在字符串str1的后面。例如:str1=“How do”,str2=“you do?”,结果输出: How do you do?注意:部分源程序给出如下。请勿改动主函数main和其他函数中的任何内容,仅在函数fun的横线上填入所编写的若干表达式或语句。试题程序:include<stdio.h>include<conio.h>define N 40void fun(char*str1,char *str2){int i=0;char *pl=str1;char*p2=str2;while(【 】)i++;for(;【 】;i++)*(p1+i)=【 】;*(p1+i)='\0';}main(){char str1[N],str2[N);clrscr();printf("*****Input the string str1 Str2*****\n");printf("\nstr1:");gets(str1);printf("\nstr2:");gets(str2);printf("**The string str1 str2**\n");puts(str1);puts(str2);fun(str1,str2);printf("*****The new string *****\n");puts(str1);}
假定有以下函数过程: Function Fun(S As String) As String Dim s1 As String For i=1 To Len(S) s1 = UCase(Mid(S, i, 1)) +s1 Next i Fun =s1 End Function 在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim Str1 As String, Str2 As String Strl = InputBox(“请输入一个字符串”) Str2=Fun(Str1) Print Str2 End Sub 程序运行后,单击命令按钮,如果在输入对话框中输入字符串“abcdefg”,则单击“确定” 按钮后在窗体上的输出结果为,A.abcdefgB.ABCDEFGC.gfedcbaD.GFEDCBA
设有语句: char str1[]="string",str2[8],*str3,*str4="string"; 则下列对库函数strcpy()调用不正确的是( )。A.strcpy(str1,"Hell01");B.strcpy(str2,"Hell02");C.strcpy(str3,"Hell03");D.strcpy(str4,"Hell04");
下面代码的运行结果是( )。 public class ConcatTest { public static void main (String[ ] args) { String str1 = "abc"; String str2 = "ABC"; String str3 = str1. coneat(str2); System. out. println(str3); } }A.abcB.ABCC.abcABCD.ABCabc
设有以下语句: char strl[]="string",str2[8],*str3,*str4="string"; 则_______不是对库函数的正确调用。A.strcpy(strl,"HELLO1");B.strcpy(str2,"HELLO2");C.strcpy(str3,"HELLO3");D.strcpy(str4,"HELLO4");
阅读下面程序 public class ConcatTest{ public static void main(String[] args) { String strl = "abc"; String str2 = "ABC"; String str3 = str1.concat(str2); System.out.println(str3); } } 程序的运行结果是:A.abeB.ABCC.abcABCD.ABCabc
设有语句:char str1[]="string", str2[8], *ste3, *str4="string";,则下列不是对库函数 strcpy的正确调用的是______。A.strcpy(str1,"HELLOI");B.strcpy(str2,"HELLO2");C.strcpy(str3,"HELLOY");D.strcpy(str4,"HELLO4");
执行下面的程序,单击窗体后在窗体上显示的结果是 ______。Private Sub form_ Click() Dim Str1 As String, Str2 As String Dim Str3 As String, I As Integer Str1 = "e" for I = t To 2 Str2 = Ucase (Str1) Str1 = Str2 Str1 Str3 = Str3 Str1 str1 = Chr (Asc(Str1) + I) Next I Print Str3End SubA.EeFFB.eEfFC.EEFFD.eeFF
本题分别比较两个字符串"A"和"a"是否相等,并比较两个字符"A"和"a"是否相等,并输出比较结果。public class javal{public static void main(String[]args){;cl=‘A ‘;c2=‘a‘;String strl=new String("A"),str2=new String("a"):if( )System.Out.println("char"+c1+"equals"+"char"+c2);elseSystem.OUt.println("char"+cl+"doesn‘t equal"+"char"+c2);if( )System.out.println("string"+strl+"equals"+"string"+str2):elseSystem.OUt.println("string"+strl+"doesn‘t e-qual"+"string"+str2); .}}
假定有以下函数过程: Function Fun(S As String) As String Dim s1 As String For i=1 To Len(S) s1=UCase(Mid(S,i,1))+s1 Next i Fun=S1 End Function 在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Command1_Click( ) Dim Str1 As String,Str2 As String Str1=Input Box(“请输入一个字符串”) Str2=Fun(Str1) Print Str2 End Sub 程序运行后,单击命令按钮,如果在输入对话框中输入字符串“abcdefg”,则单击“确定”按钮后在窗体上的输出结果为A.abedergB.ABCDEFGC.gfedcbaD.GFEDCBA
执行以下语句后,str2的值是( )。 String str1="abc"; String str2=strconcat("cde");A.abcdeB.abccdeC.cdeabcD.edccba
设有以下语句: char str1[]= “string”,str2[8],*str3,*str4= “ string”; 则不能对库函数strcpy(复制字符串)的正确调用的是()A、strepy(str1,“HELLO1”);B、strepy(str2,“HELL02”);C、strcpy(str3, “HELL03”)D、strcpy(str4, “HELLO4”);
String date="Today is Sunday.";String str2=data.CharAt(s.length( )-1);则str2为()A、yB、.C、nullD、false
假如有字符串str1和字符串str2,下列选项不能利用于比较这两个字符串是否相等的是()。A、string.Compare(str1,str2)B、str1= =str2C、string.Equals(str1,str2)D、string.CompareTo(str1,str2)
下列程序的执行结果是()。 classProgram{ publicstaticvoidMain(string[]args) { stringstr1,str2; str1=”abdde”; str2=”abcdefg”; Console.WriteLine(“{0}”,str1==str2); } }
下面()是不正确的字符串赋值或赋初值的方式。A、char*str;str=“string”;B、charstr[7]={‘s’,‘t’,‘r’,‘i’,‘n’,‘g’};C、charstr1[10];str1=“string”;D、charstr1[]=“string”,str2[]=“12345678”;
单选题设有以下语句: char str1[]= “string”,str2[8],*str3,*str4= “ string”; 则不能对库函数strcpy(复制字符串)的正确调用的是()Astrepy(str1,“HELLO1”);Bstrepy(str2,“HELL02”);Cstrcpy(str3, “HELL03”)Dstrcpy(str4, “HELLO4”);
填空题下列程序的执行结果是()。 classProgram{ publicstaticvoidMain(string[]args) { stringstr1,str2; str1=”abdde”; str2=”abcdefg”; Console.WriteLine(“{0}”,str1==str2); } }
单选题下面()是不正确的字符串赋值或赋初值的方式。Achar*str;str=“string”;Bcharstr[7]={‘s’,‘t’,‘r’,‘i’,‘n’,‘g’};Ccharstr1[10];str1=“string”;Dcharstr1[]=“string”,str2[]=“12345678”;
单选题若有定义语句:char str1[] = "string", str2[8], *str3, str4[10] = "string";库函数strcpy的功能是复制字符串,以下选项中错误的函数调用是( )。Astrcpy(str3, "HELLO!");Bstrcpy(str2, "HELLO!");Cstrcpy(str1, "HELLO!");Dstrcpy(str4, "HELLO!");