Board logo

標題: 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




歡迎光臨 香港 Xocat Forum 討論區 (http://p.xocat.com/p/) Powered by Discuz! 6.0.0