[单项选择题] 单击窗体时,下列程序的执行结果是  Private Sub Invert(By Val xstr As String,ystr As String)    Dim tempstr AS

15 查阅

[单项选择题] 单击窗体时,下列程序的执行结果是  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 Sub

A.abcdef

B.afbecd

C.fedcba

D.defabc

参考答案:

C

解析:Invert(By Val xstr As String,ystr As String)的作用是将参数xstr的字符逆序处理,然后赋值给ystr,而ystr是按地址引用的,可以直接返回处理结果。

计算机考试