下面程序的输出结果是 Private Sub Command1_Click() ch$="ABCDEF" proc ch Print ch End Sub Private Sub proc(ch As String) S="" For k=Len(ch) To 1 Step-1 s=s & Mid(ch,k,1) Next k ch=s End Sub
举一反三
- 下面程序的输出结果是( )Private Sub proc(ch As String) s = "" For k = Len(ch) To 1 Step -1 s = s & Mid(ch, k, 1) Next k ch = sEnd SubPrivate Sub Command1_Click() ch$ = "ABCDEF" proc ch Print ch End Sub A: ABCDEF B: A C: FEDCBA D: F
- 执行以下程序后输出的是 Private Sub Command1_Click() Ch = "AABCDEFGH" Print Mid(Left(Ch, 8), Len(Left(Ch, 4)), 2) End Sub
- 设有如下事件过程:Private Sub Command1_Click() ch = "ABCDEFG" n = Len(ch) k = 1 Do Print Mid(ch, k, 1); Mid(ch, n, 1); k = k + 1 n = n - 1 Loop Until k > nEnd Sub运行此过程所产生的输出是 A: AGBFCEDD B: AGBFCED C: GFEDCBA D: GAFBECD
- 下面程序运行时,若输入“Visual Basic Prograrmming”,则在窗体上输出的是( ) Private Sub Command1_Click() Dim count(25)As Integer,ch As String ch=Ucase(InputBox("请输入字母字符串")) For k=1 To Len(ch) n=Asc(Mid(ch,k,1))-Asc("A") If n>=0 Then count(n)一count(n)+1 End If Next k m=count(0) For k=1 To 25 If m<count(k) Then m=count(k) End If Next k Print m End Sub A: 0 B: 1 C: 2 D: 3
- 下列程序运行后输出结果是_______. Private Sub Form_Click() K=1 For I=5 to 1 step -1 T=T*10 + K S=S+T Next I Print S End sub