VB問題
問題:
Set side to the value input
Set row to 1
If side is less than or equal to 25
While row is less than or equal to side
Set column to one
While column is less than or equal to side
Print #
Increment column by one
Print a line feed/carriage return
Increment row by one
Else
Print “Side is too large”
我的ANSWER:
Dim side As Integer, row As Integer, column As Integer
row = 1
column = 1
Console.Write("Input side:")
side = Console.ReadLine()
If side <= 25 Then
While row <= side
While column <= side
Console.WriteLine("#")
column = column + 1
row = row + 1
End While
End While
Else
Console.WriteLine("Side is too large")
End If
請問有冇錯呀?
同埋點做Print a line feed/carriage return?
THANK YOU