推介:| Web Hosting | 外賣系統 | Server colocation | Web Shop System | Makeup course |

查看完整版本: VB問題

bid_real 2007-10-17 21:21

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

bestpal 2007-10-20 21:40

use of control character for line feed/carriage return... #10/#13
you may check with ascii table instead
頁: [1]
查看完整版本: VB問題