vb.net vb控制台 九九乘法

页面导航:首页 > 软件编程 > vb.net > vb.net vb控制台 九九乘法

vb.net vb控制台 九九乘法

来源: 作者: 时间:2016-01-18 16:54 【

通过vb控制台 输出九九乘法表[vb]Module Module1 Sub Main() Dim i, j, temp As Short For i = 1 To 15 Console.Write( ) Next Console.WriteLine(九九乘法表) Console.WriteLine() C...

通过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 

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
 

 运行效果:

 \

Tags:

文章评论

最 近 更 新
热 点 排 行
Js与CSS工具
代码转换工具

<