【单选题】下面的哪些程序片段可能导致错误A.String s = “Hello” ; String t = “World” ; String k = s+t ;B.String s = “hello” ; String t ; t = s[3]+”one” ;C.String s = “Hello” ;D.String s = “Hello world!” ;
【单选题】下面的哪些程序片段可能导致错误
A.String s = “Hello” ; String t = “World” ; String k = s+t ;
B.String s = “hello” ; String t ; t = s[3]+”one” ;
C.String s = “Hello” ;
D.String s = “Hello world!” ;
参考答案和解析
C
相关考题:
下面的哪些程序片段可能导致错误()。 A.Strings=“Gonewiththewind”;Stringt=“good”;Stringk=s+t;B.Strings=“Gonewiththewind”;Stringt;t=s[3]+“one”;C.Strings=“Gonewiththewind”;Stringstandard=s.toUpperCase();D.Strings=“homedirectory”;Stringt=s–“directory”;
下面的哪些程序段可能导致错误? ( ) Ⅰ: String s = "Gone with the wind"; String t = "good "; String k = s + t; Ⅱ: String s = "Gone with the wind"; String t; t = s[3] + "one"; Ⅲ: String s = "Gone with the wind"; String standard = s.toUpperCase(); Ⅳ: String s = "home directory"; String t = s-"directory":A.Ⅱ、ⅢB.Ⅱ、ⅣC.Ⅰ、ⅣD.Ⅲ、Ⅳ
若x是int型变量,且有下面的程序片段: for(x=3;x<6;x++)printf(x%2)?("* *%d"):(”# #%d\n”),x); 上面程序片段的输出结果是 ( )A.* * 3 # # 4 * * 5B.# # 3 * * 4 # # 5C.# # 3 * * 4 # # 5D.* * 3 # # 4 * * 5
若有下面的程序片段: int[12]={0},*p[3],**pp,i; for(i=0;i<3;i) p[i]=a[i*4]; pp=p 则对数组元素的错误引用是A.pp[0][1]B.a[10]C.p[3][1]D.*(*(p+2)+2)
若k是int型变量,且有下面程序片段: k=-3; if(k 若k是int型变量,且有下面程序片段: k=-3; if(k<=0)printf("# # # #") else printf(" ") 上面程序片段的输出结果是 ( )A.# # # #B. C.# # # D.有语法错误,无输出结果
下面的哪些程序片断可能导致错误() A、String s = "Gone with the wind"; String t = " good "; String k = s + t;B、String s = "Gone with the wind"; String t; t = s[3] + "one";C、String s = "Gone with the wind"; String standard = s.toUpperCase();D、String s = "home directory"; String t = s - "directory"
下面的哪些程序片段可能导致错误()。 A、String s = “Gone with the wind”; String t = “ good”; String k = s + t;B、String s = “Gone with the wind”; String t; t = s[3] + “one”;C、String s = “Gone with the wind”; String standard = s.toUpperCase();D、String s = “home directory”; String t = s – “directory”;
多选题下面的哪些程序片段可能导致错误()。AString s = “Gone with the wind”; String t = “ good”; String k = s + t;BString s = “Gone with the wind”; String t; t = s[3] + “one”;CString s = “Gone with the wind”; String standard = s.toUpperCase();DString s = “home directory”; String t = s – “directory”;
多选题下面的哪些程序片断可能导致错误()AString s = Gone with the wind; String t = good ; String k = s + t;BString s = Gone with the wind; String t; t = s[3] + one;CString s = Gone with the wind; String standard = s.toUpperCase();DString s = home directory; String t = s - directory