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

沒有留言:

張貼留言

2024年4月24日 星期三 Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --2

 2024年4月24日 星期三 Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --2 AngularJS 實例 <!DOCTYPE html> <html> <head> &...