单选题
VB
题号 #484989
设有如下通用过程:
Public Function Fun(xStr As String)As String
Dim tStr As Strin9,strL As Integer
tStr=“”
strL=Len(xStr)
i=l
Do While i<=strL/2
tStr=tStr&Mid(xStr,i,1)&Mid(xStr,strl-i+1,1)
i=i+1
Loop
Fun=tStr
End Function
在窗体上画一个名称为Command1的命令按钮。然后编写如下的事件过程:
Private Sub Command l_Click()
DimSl As String
S 1=“abcdef”
Print UCase(Fun(S 1))
End Sub
程序运行后,单击命令按钮,输出结果是 ( )
参考答案
C
答案解析
函数Fun(xStrAs string)的功能是将字符串xStr中第l个字符、倒数第1个字符、第2个字符、倒数第2个字符、…、中间字符组成一个新的字符串。uCase(x)将字符串中的所有字母变成大写。所以,答案是C。
你可能感兴趣的试题
A.把p=1改为p=n
B.把For k=n-1 T0 2 Step-1改为For k=1 To 1
C.把For k=n-l T0 2 Step-1改为For k=l To n
D.把For k=1 T0 2 Ste1改为For k=2 To n
A.ABCDEFG
B.abcdefg
C.GFEDCBA
D.gfedcba
A.把For k=l TO n改为For k=2 To n
B.把p=p*a改为p=p^n
C.把For k=l To n改为For k=l To n-l
D.把p=a改为p=l