2019年5月2日 星期四

九九乘法表




Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim answer As Integer
        Dim i, j, k As Integer
        Dim KtoK As String
        KtoK = ""

        For k = 2 To 9 Step 4

            For i = 1 To 9 Step 1

                For j = k To k + 3 Step 1

                    KtoK &= j & "*" & i & "=" & i * j & vbTab

                Next j
                KtoK &= vbNewLine

            Next i
            KtoK &= vbNewLine

        Next k

        answer = MsgBox(KtoK, MsgBoxStyle.OkOnly, "九九乘法表")

    End Sub

End Class

1 則留言:

  1. 發大財.右腿經濟.左腿政治.右左發大財

    回覆刪除