2、下列语句输出的结果是________。 s1={1,4,5,6} s2={1,3,6,7} print(s1.union(s2))A.{1, 3, 4, 5, 6, 7}B.{1, 6}C.{4, 5}D.{3, 4, 5, 7}
2、下列语句输出的结果是________。 s1={1,4,5,6} s2={1,3,6,7} print(s1.union(s2))
A.{1, 3, 4, 5, 6, 7}
B.{1, 6}
C.{4, 5}
D.{3, 4, 5, 7}
参考答案和解析
[1, 3, 4, 5]
相关考题:
以下程序的输出结果是 【 18 】 。# include stdlib.hmain( ){ char *s1,*s2,m;s1=s2=(char*)malloc(sizeof(char));*s1=15; *s2=20; m=*s1+*s2;printf("%d\n",m);}
若已包含头文件stdio.h且有说明chars1[5],s2[7];要给s1,s2赋值,下列语句中正确的是() A、s1=getchar();s2=getchar();B、scanf(“%s%s”,s1,s2);C、scanf(“%c%c”,s1,s2);D、gets(s1);s2=s1;
以下程序的输出结果是______# includemain(){char *s1,*s2,m;s1=s2=(char*)malloc(sizeof(char));*s1=15;*s2=20;m=*s1+*s2;printf(“%d\n”,m);}
下列程序的输出结果为( )。 S1=”1”:S2=”2”:SI=Val(S1)+Val(S2):S2=Val(”12”) If S1S2 Then P int S1-S2 Else Print S2-S1A.-9B.9C.-12D.0
下列语句中,在字符串s1和s2相等时显示"they are Equal"的是( )。A.if(*s1==*s2) puts("they are Equal");B.if(!strcmp(s1,s2)) puts("they are Equal");C.if(s1==s2) Puts("they are Equal");D.if(strcmp(s1,s2) ) puts("they are Equal");
(14)有下列程序,程序运行后单击命令按钮,则输出的结果是 Private Sub Command1_Click() Dim a%(1 To 4),b%(3 To 6),i%,s1#,s2# For i=1 To 4 a(i)=i Next i For i=3 To 6 b(i)=i Next i s1=Factorial(a) S2=Factorial(b) Print"s1=";s1;"s2";s2; End Sub Function Factorial(a()As Integer) Dim t#,i% t=1 For i=LBound(a) To UBound(a) t=t*a(i) Next i Factorial=t End Factorial A.s1=360 s2=24 B.s1=24 s2=360 C.s1=24 s2=24 D.s1=360 s2=360
(8)下列程序在窗体上输入,在立即窗口中输入________。 S1="software" S2="hardware" S3="computer" Print Right(S1,3) Picture1.Print Mid(S2,2,4) Debug.Print Left(S3,2)
若有定义语句:“char*s1=”0K”,*s2=”ok”;”,以下选项中,能够输出“OK”的语句是( )。A.if(strcmp(sl,s2)= =0)puts(s1);B.if(strcmp(sl,s2)!=0)puts(s2);C.if(strcmp(sl,s2)= =l)puts(s1);D.if(stremp(sl,s2)!=0)puts(s1);
若有以下说明:chars1[]={"tree"},s2[]={"flower"};,则以下对数组元素或数组的输出语句中,正确的是()。A.printf("%s%s",s1[5],s2[7]);B.printf("%c%c",s1,s2);C.puts(s1);puts(s2);D.puts(s1,s2);
若有以下定义和语句: char*s1="12345",*s2="1234"; printf("%d\n",strlen(strcpy(s1,s2)));则输出结果是______。A.4B.5C.9D.10
publicclassSyncTest{publicstaticvoidmain(Stringargs){finalStringBuffers1=newStringBuffer();finalStringBuffers2=newStringBuffer();newThread(){publicvoidrun(){synchronized(s1){s2.append(A”);synchronized(s2){s2.append(B”);System.out.print(s1);System.out.print(s2);}}}}.start();newThread(){publicvoidrun(){synchronized(s2){s2.append(C”);synchronized(s1){s1.append(D”);System.out.print(s2);System.out.print(s1);}}}}.start();}}Whichtwostatementsaretrue?()
以下程序的输出结果是______。includeincludefun(char*w,int n){ char t,*s 以下程序的输出结果是______。 #include<stdio.h> #include<string.h> fun(char*w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) { t=*s1++; *s1=*s2-; *s2=t; } } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }A.1234567B.7654321C.1711717D.7177171
下列程序的输出结果为( )。S1=”1”:S2=”2”:SI=Val(S1)+Val(S2):S2=Val(”12”)If S1S2 Then P int S1-S2 Else Print s1-S2A. -9B. 9C. -12D. 0
若已包括头文件和,运行下列程序段时输出结果是()。int i=0;char s1[10]="ABCD 若已包括头文件<stdio.h>和<string.h>,运行下列程序段时输出结果是( )。 int i=0; char s1[10]="ABCD",s2[10]="EFG"; strcat(s1,S2); while(s2[i++]!='\0') s2[i]=s1[i]; puts(s2);A.ABCB.ABCDEFC.EBCDEFGD.CBD
下列程序运行后,输出结果是______。 include include fun(char *w ,int 下列程序运行后,输出结果是______。 #include <stdio. h> #include <string. h> fun (char *w ,int n) { char t,*s1,*s2; s1=w; s2=w+n-1; while (s1<s2) { t=*s1++; *s1=*s2--; *s2=t; } } main () { char *p; p="1234567"; fun (p, strlen (p)); puts (p); }A.1234567B.7654321C.1711717D.7177171
下列语句输出结果为( )。 public class test { public static void main(StringArgsl[]) { String s1=new String("How"); String s2=new String("How"); System.out.println(!(s1==s2)); } }A.falseB.trueC.1D.0
若有以下定义语句: char * sl="12345", * s2="1234"; printf("%d"n",strlen(strcpy(s1,s2))); 则输出结果是 ( )A.4B.5C.9D.10
下列语句输出结果为( )。public class test{public static void main(String args []){String s1=new String("How");String s2=new String("How");System.out.println(!(s1 ==s2));}A.falseB.trueC.1D.0
若有定义语句:char}sl=‘’0K”,:It s2=”ok”;以下选项中,能够输出“OK”的语句是( )。A.if(strcmp(sl,s2)!=0)puts(s2);B.if(strcmp(sl,s2)!=0)puts(s1);C.if(strcmp(sl,s2)==1)puts(s1);D.if(strcmp(sl,s2)==0)puts(s1);
以下程序的输出结果是_______。includeincludefun(char*w,int n){char t,*s 以下程序的输出结果是_______。 #include<stdio.h> #include<string.h> fun(char*w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) { t=*s1++: *sl=*s2-; *s2=t; } } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }A.1234567B.7654321C.1711717D.7177171
下列代码的执行结果是______。 public class ex55 { public static void main(String args[] ) { String s1=new String("hello"); String s2=new String("hello"); System.out.print (s1==s2); System.out.print (","); System.out.println (s1.equals (s2)); } }A.true, falseB.true, trueC.false, trueD.false, false
以下程序的输出结果是( )。 include main() {char*s1,*s2,m; s1=s2=(char*)malloc(size 以下程序的输出结果是( )。include<stdlib.h>main(){char*s1,*s2,m;s1=s2=(char*)malloc(sizeof(char));*s1=15;*s2=20;m=*s1+*s2:printf("%d\n",m);}
( 31 )若有以下定义和语句char s1[10]= " abcd! " ,*s2= " \n123\\ ";printf ( " %d %d\n ", strlen ( s1 ) ,strlen ( s2 ) ) ;则输出结果是A ) 5 5B ) 10 5C ) 10 7D ) 5 8
下述语句中,在字符串s1和s2相等时显示”they are Equal”的是( )。A)if(*s1==*s2)puts("they are Equal");B)if(!strcmp(s1,s2))puts("they are Equal");C)if(s1=s2)puts(”they are Equal”);D)if(strcmp(s1,s2))puts(”they are Equal”);
在下面的条件语句中(其中S1和S2表示C语言语句),只有一个在功能上与其他三个语句不等价()。A、if(a)S1;else S2;B、if(a==0)S2;else S1;C、if(a!=0)S1;else S2;D、if(a==0)S1;else S2;
单选题若有以下定义和语句:char s1[10]=abcd!, *s2=n123\\;printf(%d%d, strlen(s1), strlen(s2));则输出结果是( )。A55B105C107D58
单选题若有定义语句char*s1="OK",*s2="ok";以下选项中能够输出"OK"的语句是( )。Aif(strcmp(s1,s2)==0)puts(s1);Bif(strcmp(s1,s2)!=0)puts(s2);Cif(strcmp(s1,s2)==1)puts(s1);Dif(strcmp(s1,s2)!=0)puts(s1);