剛學VB.NET第二天,來練習一下吧...
Module Module1
Sub Main()
Dim x As Integer = 11
For a = 1 To (x + 1) / 2
For b = (x + 1) / 2 - a To 1 Step -1
Console.Write(" ")
Next
For c = 1 To 2 * a - 1
Console.Write("*")
Next
Console.WriteLine()
Next
For d = (x + 1) / 2 - 1 To 1 Step -1
For e = (x + 1) / 2 - d To 1 Step -1
Console.Write(" ")
Next
For f = 2 * d - 1 To 1 Step -1
Console.Write("*")
Next
Console.WriteLine()
Next
Console.Read()
End Sub
End Module
參考: http://it-easy.tw/vbdiam/
沒有留言:
張貼留言