回覆列表
  • 1 # 使用者5376173803818

    Private Sub Command1_Click()

    Dim a(10) As Long, b(5) As Long, i As Integer

    For i = 1 To 10 輸入資料

    a(i) = InputBox("請輸入第" & i & "個數", "整數輸入")

    Next i

    For i = 1 To 10 "顯示調換前的資料

    Text1.Text = Text1.Text & vbCrLf & "a(" & i & ") =" & a(i)

    Next i

    For i = 1 To 5 "資料調換

    b(i) = a(i)

    a(i) = a(i + 5)

    a(i + 5) = b(i)

    Next i

    For i = 1 To 10 "顯示調換後的資料

    Text2.Text = Text2.Text & vbCrLf & "a(" & i & ") =" & a(i)

    Next i

    End Sub

  • 中秋節和大豐收的關聯?
  • 蜀山戰紀2餘英男終局是什麼最後跟誰在一起了(2?