vb用inputbox输入10个整数并逆序输出

vb用inputbox输入10个整数并逆序输出
2024-12-02 21:40:43
推荐回答(1个)
回答1:

Private Sub Command1_Click()

Dim a(10)

Print "原始整数为:"

For i = 1 To 10

  a(i) = Val(InputBox("请输入第" & i & "个整数:"))

  Print a(i);

Next i

Print

Print "逆序输出的整数:"

For i = 10 To 1 Step -1

  Print a(i);

Next i

Print

End Sub