vb.net vb控制台 九九乘法

前端之家收集整理的这篇文章主要介绍了vb.net vb控制台 九九乘法前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

通过vb控制台 输出九九乘法表

Module Module1

    Sub Main()
        Dim i,j,temp As Short
        For i = 1 To 15
            Console.Write("  ")
        Next
        Console.WriteLine("九九乘法表")
        Console.WriteLine()
        Console.Write("* ")
        For i = 1 To 9
            Console.Write("  {0}",i)
        Next
        Console.WriteLine()
        For i = 1 To 9
            Console.Write("{0} ",i)
            For j = 1 To i
                temp = i * j
                If (temp >= 10) Then
                    Console.Write(" {0}",temp)
                Else
                    Console.Write("  {0}",temp)
                End If
            Next j
            Console.WriteLine(" ")
        Next i
        Console.ReadLine()
    End Sub

End Module


运行效果

猜你在找的VB相关文章