下面程序段运行后,s2的值为_________。 Dim i As Integer Dim s1, s2 As String s2 = "" s1 = "程序设计VB.NET" For i = 1 To Len(s1) s2 = Mid(s1, i, 1) s2 NextA.TEN.BV计设序程B.程序设计VB.NETC.VB.NET程序设计D.程序设计
下面程序段运行后,s2的值为_________。 Dim i As Integer Dim s1, s2 As String s2 = "" s1 = "程序设计VB.NET" For i = 1 To Len(s1) s2 = Mid(s1, i, 1) & s2 Next
A.TEN.BV计设序程
B.程序设计VB.NET
C.VB.NET程序设计
D.程序设计
参考答案和解析
36
相关考题:
下面运行程序后,单击命令按钮,输出的结果是______。Private Sub Commandl_clck()Dim a%(1 To 4),b%(3 To 6),i%,s1,s2Fori=1 To 4a(i)=iNextiFor i=3 To 6b(i)=iNextis1=YAS(a)S2=YAS(b)Printt"s1=";S1"S2=";s2End Sub
下列程序段的输出结果为______。Dim S1(5)As Integer,S2(5)As Integer,S3(5)As IntegerN=4ForI=1 To NS1(I)=IL=N+i-IS2(I)=LNextIS3(5)=0ForK=1 To NS3(K)=S1(K)*S2(K)S3(5)=S3(5)+S3(K)NextKPrintS1(3)=S1(5);S1(2)PrintS2(4)=S3(
下列程序的执行结果为Private Sub Command1_Click()Dim s1 As String, s2 As Strings1= "abcd"Call Transfer(s1, s2)Print s2End SubPrivate Sub Transfer (ByVal xstr As String, ystr As String)Dim tempstr As Stringi=Len(xstr)Do While i =1tempstr=tempstr + Mid(xstr, i, 1)i=i - 1Loopystr=te mpstrEnd Sub( )。A.dcbaB.abdcC.abcdD.dabc
单击窗体时,下列程序的执行结果是Private Sub Invert(ByVal xstr As String, ystr As String)Dim tempstr As StringDim I As IntegerI=Len(xstr)Do While I =1tempstr=tempstr + Mid(xstr, I, 1)I=I - 1Loopystr=tempstrEnd SubPrivate Sub Form_Click()Dim s1 As String, s2 As Strings1= "abcdef"Invert s1, s2Print s2End Sub( )。A.abcdefB.afbecdC.fedcbaD.defabc
若已包括头文件且已有定义char s1[18],s2={"ABCDE"}和int i,现要将字符串“ABCDE”赋给s 若已包括头文件<string.h>且已有定义char s1[18],s2={"ABCDE"}和int i,现要将字符串“ABCDE”赋给s1,下列语句错误的是( )。A.strcpy(s1,s2)B.strcpy(sl,"ABCDE");C.s1="ABCDE";D.for(i=0;i<6;i++) s1[i]=s2[i];
若已包括头文件且已有定义char s1[18],s2={"ABCDE"}和int i,现要将字符串 "ABCDE"赋给 若已包括头文件<string.h>且已有定义char s1[18],s2={"ABCDE"}和int i,现要将字符串 "ABCDE"赋给s1,下列语句错误的是( )A.strcpy(s1,s2)B.strcpy(s1,"ABCDE");C.s1="ABCDE";D.for(i=0;i<6;i++) s1[i]=s2[i];
(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
阅读以下函数fun(char *sl,char *s2){ int i=0;while(sl[i]==s2[i]s2[i]!='\0') i++;return(sl[i]=='\0's2[i]=='\0');}此函数的功能是A.将s2所指字符串赋给s1B.比较s1和s2所指字符串的大小,若s1比s2的大,函数值为1,否则函数值为0C.比较s1和s2所指字符串是否相等,若相等,函数值为1,否则函数值为0D.比较s1和s2所指字符串的长度,若s1比s2的长,函数值为1,否则函数值为0
对于下面的程序includeincludechar *scmp(char*s1,char*s2){if(strcmp(s1, 对于下面的程序 #include<stdio.h> #include<string.h> char *scmp(char*s1,char*s2) { if(strcmp(s1,s2)<0)return(s1); else return(s2); } main() { int i:char string[20],sb[3][20]; for(i=0;i<3;i++)gets(str[i]); strcpy(string,scmp(str[0],str[1])); strcpy(string,scmp(string,str[21)); printf("%s\n",string); } 若运行时依次输入abcd、abba和abc三个字符串,则输出结果为______。A.abcdB.abbaC.abcD.abca
对于下面的程序includeincludechar * scmp(char * s1,char * s2){if(strcm 对于下面的程序 #include<stdio.h> #include<string.h> char * scmp(char * s1,char * s2) { if(strcmp(s1,s2)<0)return(s1); else return(s2); } main() { int i;char string[20],str[3][20]; for(i=0;i<3;i++)gets(str[i]); strcpy(string,scmp(str[0],str[1])); strcpy(string,scmp(string,str[2])); printf("%s\n",string); } 若运行时依次输入abcd、abba和abc三个字符串,则输出结果为 ______。A.abcdB.abbaC.abcD.abca
若有以下程序,当程序运行后,单击命令按钮,则输出的结果为( )。 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 FunctionA.s1=360 s2=24B.s1=24 s2=360C.s1=24 s2=24D.s1=360 s2=360
有下列程序,程序运行后单击命令按钮,则输出的结果为( )。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=";s2End SubFunction Factorial(a()As Integer)Dim t#,i% t=1 For i=LBound(A)To UBound(A) t=t*a(i) Next i Factorial=tEnd FunctionA.s1=360 s2=24B.s1=24 s2=360C.s1=24 s2=24D.s1=360 s2=360
若已包括头文件和,运行下列程序段时输出结果是()。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
阅读以下函数: fun(char*s1, char*s2) { int i=0; while(s1[i]==s2[i] s2[i]!='\0') i++; return(s1[i]== s2{i)!=='\0'); } 此函数的功能是( )。A.将s2所指字符串赋给s1B.比较s1和s2所指字符串的大小,若s1比s2的大,函数值为1,否则函数值为0C.比较s1和s2所指字符串是否相等,若相等,函数值为1,否则函数值为0D.比较s1和s2所指字符串的长度,若s1比s2的长,函数值为1,否则函数值为0
编写如下事件过程: Private sub sub1 (ByVal x1 As String, y1 As String) Dim xt As String Dim i As Integer i = Len(x1) Do While i>= 1 xt = xt + Mid(x1, i, 1) i=i-1 Loop y1 = xt End Sub Private Sub Form. Click() Dim s1 As String, s2 As String s1= "teacher" sub1 s1, s2 Print s2 End Sub 程序运行后,单击窗体,则窗体上显示的内容是A.rehcaetB.tahreeeC.themeeD.eerthea
有下列程序,程序运行后单击命令按钮,则输出的结果是( )。Private Sub Command1_Click()Dim a%(1 To 4),b%(3 To 6),i%,s1#,s2#For i=1 To 4a(i)=iNext iFor i=3 To 6b(i)=iNext is1=Factorial(A)s2=Factorial(B)Print"s1=";s1;"s2=";s2End SubFunction Factorial(a() As Integer)Dim t#,i%t=1For i=LBound(A)To UBound(A)t=t*a(i)Next iFactorial=tEnd FunctionA.s1=360 s2=24B.s1=24 s2=360C.s1=24 s2=24D.s1=360 s2=360
以下程序中函数scmp的功能是返回形参指针s1和s2所指字符串中较小字符串的首地址。 #include<string> char*scmp(char*s1,char*s2) { if(strcmp(s1,s2)<0) return(s1); else retrun(s2); } main() { int i;char string[20],str[3][20]; for(i=0;i<3;i+A.abcdB.abbaC.abcD.abca
单击窗体时,下列程序的执行结果是 Private Sub Invert(By Val xstr As String,ystr As String) Dim tempstr AS String Dim I AS Integer I=Len(xstr) Do While I>=1 tempstr=tempstr + Mid(xstr,I,1) I=I - 1 Loop ystr=tempStr End Sub Private Sub Form_Click( ) Dim s1 As String,s2 As String S1="abcdef" Invert S1,S2 Print S2 End SubA.abcdefB.afbecdC.fedcbaD.defabc
下列程序的执行结果为 Private Sub Command1_C1ick( ) Dim sl As String,s2 AS String s1="abcdef" Call lnvert(s1,s2) Print s2 End Sub Private Sub lnvert(ByVal xstr As String,ystr As String) Dim tempstr As Stdng i=Len(xstr) Do While i>=1 tempstr=tempstr+Mid(xstr,i,1) i=i-1 Loop ystr=tempstr End SubA.fedcbaB.abcdefC.afbecdD.defabc
运行下列程序:Private Sub Command1_Click( )Dim s1 As String * 1Dim s2 As Strings1 = aFor i = Asc(s1) To Asc(s1) + 4s2 = s2 Chr(i)Next iPrint s2End Sub单击Command1命令按钮后,则在窗体上显示的结果是( )。A.aB.abcdeC.aaaaD.s2
下列程序的执行结果为 Private Sub Command1_Click() Dim s1 As String,s2 As String S1;="abcdef" Call Invert(s1,s2) Print s2 End Sub Private Sub Invert (ByVal xstr As String,ystr As String) Dim tempstr As String i=Len(xstr) Do While i=1 tempstr=tempstr+Mid(xstr,i,1) i=i-1 Loop ystr=tempstr End SubA.fedcbaB.abcdefC.afbecdD.defabc
下列程序的执行结果为 Private Sub Commandl_Click() Dim s1 As String ,s2 As String s1= "abcd" Call Transfer(sl,s2) Print s2 End Sub Private Sub Transfer (ByVal xstr As String,ystr As String) Dim tempstr As String ystr=tempstr End SubA.dcbaB.abdcC.abcdD.dabc
下面运行程序后,单击命令按钮,输出的结果是【 】。Private Sub Command1_Click()Dim a%(1 To 4),b%(3 To 6),i%,s1,s2For i=1 To 4a(i)=iNextFor i=3 To 6b(i)=iNexts1.= Fun(a)s2 =Fun(b)Print "s1 ="; s1; "s2 ="; s2End SubFunction Fun( a( ) As Integer)Dim t, i%t=1For i = LBound(A)To UBound(a)t=t * a(i)NextFun=tEnd Function
以下程序的输出结果为( )。main( ){ char s1[40]="country",s2[20]="side";int i=0,j=0;while(s1[i]!='\0') i++;while(s2[j]!='\0') s1[i++]=s2[j++];s1[i]=0;printf("%s\n",s1);}A sideB countryC sidetryD countryside
填空题设字符串S1= “ABCDEF”,S2= “PQRS”,则运算S=CONCAT(SUB(S1,2,LEN(S2)),SUB(S1,LEN(S2),2))后的串值为()。