下列程序的执行结果为 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 Sub
A.dcba
B.abdc
C.abcd
D.dabc
第1题:
在窗体上画一个命令按钮和两个文本框,其名称分别为Command1、Text1和Text2,然后编写如下程序: Dim S1 As String,S2 As String Private Sub Form_Load() Text1.Text="" Text2.Text="" End Sub Private Sub Text1_KeyDown(KeyCode As Integer,Shift As Integer) S2=S2 & Chr(Keycode) End Sub Private Sub Text1_KeyPress(KeyAscii As Integer) S1=S1 & Chr(KeyAscii) End Sub Private Sub Command1_Click() Text1.Text=S2 Text2.Text=S1 S1="" S2="" End Sub 程序运行后,在Text1中输入“abc”,然后单击命令按钮,在文本框Text1和Text2中显示的内容分别为______。
A.abc和ABC
B.abc和abe
C.ABC和abc
D.ABC和ABC
第2题:
下列程序的执行结果为 Private Sub Command1_Click Dim FirStr As String FirSt="abcdef" Print Pat(FirStr. End Sub Private Function Pat(xStr As String.As String Dim tempStr As String, strLen As Integer tempStr="" strLen=Len(xStr. i=1 Do While i<=Len(xStr.-3 tempStr=tempStr+Mid(xStr, i, 1)+Mid(xStr, strLen -i+1, 1) i=i+1 Loop Pat=tempStr End Function
A.abcdef
B.afbecd
C.fedcba
D.defabc
第3题:
下列程序的执行结果为
Private Sub Command1_Click()
Dim s1 As String, s2 As String
s1= "abcd"
Call Transfer(s1, s2)
Print s2
End Sub
Private Sub Transfer (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=te mpstr
End Sub( )。
A.dcba
B.abdc
C.abcd
D.dabc
第4题:
下列程序段: String s1=new String("How"); String s2=new String("How"); System.out.println(!(s1==s2)); 的结果为
A.false
B.true
C.1
D.0
第5题:
设有如下通用过程:
Pubfic Function Fun(xStr As String)As String
Dim tStr As String,strL As Integer
tstr=“”
strL=Len(xStr)
i=1
Do While i<=strL/2
tStr=tStr&Mid(xStr,i,1)&Mid(xStr,strL-i+1,1)
i=i+1
Loop
Fun=tStr
EndFunction
在窗体上画一个名称为Commandl的命令按钮。然后编写如下的事件过程:
Private Sub Commandl_Click()
Dim S1 As String
S1=“abcdef”
Print UCase(Fun(S1))
End Sub
程序运行后,单击命令按钮,输出结果是
A.ABCDEF
B.abedef
C.AFBECD
D.DEFABC
第6题:
(35)有下列程序段,单击命令按钮执行程序后,输出结果是 。Option Base 1Private Sub Commandl_Click() Dim x x=Array(23,-5,17,38,-31.46,11,8,5,-4) s1=0 s2=0 For k=1 To 10 If(x(k)>0)Then s1=sl+x(k) Else s2=s2+x(k) End If Next k Y=s1/Abs(s2) Print Y End SubA.148 B.40 C.-40 D.3.7
第7题:
对于下面的程序 #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.abcd
B.abba
C.abc
D.abca
第8题:
单击窗体时,下列程序的执行结果是
Private Sub Invert(ByVal 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 Sub( )。
A.abcdef
B.afbecd
C.fedcba
D.defabc
第9题:
假定有以下函数过程: 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.abcdefg
B.ABCDEFG
C.gfedcba
D.GFEDCBA
第10题:
下列程序的执行结果是______。 public class Test9 { public static void main(String[] args) { String s1 = new String("I am a girl"); String s2 = new String("I am a girl"); System.out.println (s1.equal (s2)); } }
A.true
B.假
C.I amgirl
D.都不正确