VB高手用VB编写下面键盘上输入10个数?

Private Sub Command1_Click()Dim a(1 To 10)For i = 1 To 10a(i) = Val(InputBox("输入第" i "个数"))Next i'原来的数组For i = 1 To UBound(a)Print a(i);Next iPrint'交换数值k = UBound(a)For i = 1 To k / 2m = a(i): a(i) = a(k + 1 - i): a(k + 1 - i) = mNext i'交换后的数组For i = 1 To UBound(a)Print a(i);Next iPrintEnd Sub

回复
  • 周诗芳用户

    Private Sub Command1_Click()Dim a(1 To 10)For i = 1 To 10a(i) = Val(InputBox("输入第" & i & "个数"))Next i'原来的数组For i = 1 To UBound(a)Print a(i);Next iPrint'交换数值k = UBound(a)For i = 1 To k / 2m = a(i): a(i) = a(k + 1 - i): a(k + 1 - i) = mNext i'交换后的数组For i = 1 To UBound(a)Print a(i);Next iPrintEnd Sub

    2024-11-22
    1楼
    回复

参与评论

游客评论不支持回复他人评论内容,如需回复他人评论内容请