跳轉至內容

龍語言入門/課程/獲取輸入

來自華夏公益教科書,自由的教科書

獲取輸入

[編輯 | 編輯原始碼]

我們可以使用 readln 函式從鍵盤獲取輸入。

readln 函式

[編輯 | 編輯原始碼]

語法

	select "std"

	a = readln()

示例

	select "std"
	select "types"
	
    showln "Enter the first number :"
	a = int(readln())
    showln "Enter the second number :"
	b = int(readln())
	
	showln "Sum is : " + (a + b)

輸出

	Enter the first number : 3
	Enter the second number : 4
	Sum is : 7


華夏公益教科書