设有如下程序: Private Sub Inv(ByVal xStr As String,yStr As String) Dim tStr As String Dim L As Integer L=Len(xStr) Do While L>=1 tStr=

admin2020-01-02  45

问题 设有如下程序:
Private Sub Inv(ByVal xStr As String,yStr As String)
Dim tStr As String
Dim L As Integer
L=Len(xStr)
Do While L>=1
tStr=tStr+Mid(xStr,L,1)
L=L-1
Loop
yStr=tStr
End Sub
Private Sub Form_Click()
Dim S1 As String.s2 As String
S1="abcdef"
Inv S1.S2
Print S2
End Sub
运行程序,单击窗体,输出结果为

选项 A、abcdef
B、8tbeed
C、fedeba
D、defabc

答案C

解析 Mid函数将返回字符串中从L开始的一个字符,L值从字符串长度反向递减。因此Inv函数实现字符串翻转功能。选C。
转载请注明原文地址:https://jikaoti.com/ti/K6x0FFFM
0

最新回复(0)