问题
填空题
执行下面程序,单击按钮CmdRun,窗体上显示的第一行结果是(),UBound(a)的值为(),其中a(1)的值为().
Option Explicit
Private Sub CmdRun_Click()
Dim St As String,i As Integer
Dim a() As String,j As Integer,k As Integer
St="abcd"
Call Sub1(St)
Print St
For i=1 To Len(St)
For j=i+1 To Len(St)
If Mid(St,i,1)=Mid(St,j,1) Then Exit For
Next j
If j>Len(St) Then
k=k+1
ReDim Preserve a(k)
a(k)=Mid(St,i,1)
Print "a(";k;")=";a(k)
End If
Next i
End Sub
Private Sub Sub1(S As String)
Dim i As Integer
For i=1 To Len(S)\2
Mid(S,i,1)=Mid(S,Len(S)-i+1,1)
Next i
End Sub
答案
参考答案:dccd;2;c