2017年10月14日 星期六

乘法表



Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim A, B, C, I, J As Integer
        Dim S1 As String
        S1 = Space(4)
        A = Val(TextBox2.Text)
        B = Val(TextBox3.Text)
        If A >= 19 Then
            A = 19
            TextBox2.Text = A.ToString
        End If

        If B >= 19 Then
            B = 19
            TextBox3.Text = B.ToString
        End If

        TextBox1.Clear()

        For I = 1 To A Step 1
            For J = 1 To B Step 1
                C = I * J
                TextBox1.Text = TextBox1.Text + S1
                TextBox1.Text = TextBox1.Text + C.ToString
                If J = B Then
                    TextBox1.Text = TextBox1.Text & vbNewLine & vbNewLine
                End If
            Next J

        Next I
    End Sub
End Class

沒有留言:

張貼留言

Telegram +ESP32自動發報機

  Telegram   +ESP32自動發報機 這套系統是一個典型的 IoT(物聯網)架構 ,結合了遠端配置(Python)、通訊中介(MQTT)與硬體執行(ESP32)。 以下我為您拆解這兩支程式的核心運作原理: 一、 系統架構流程 Python 端 (控制台) :使用者輸入...