Kodewick
開始學 →
入門←→0 / 70

過山車身高

#011入門if height >= 120約 2 分鐘

過山車要求身高至少 120 釐米。寫 CanRide(height):身高(釐米)夠了返回 true,不夠返回 false。正好 120 也能坐。

示例
CanRide(130)→True
CanRide(119)→False
函式func CanRide(height int) bool
main.go
package main

func CanRide(height int) bool {
	// 在這裡寫:身高夠 120,就返回 true
	return false
}
Ctrl + Enter 也能執行
結果

寫好了先點「執行」試試示例,沒問題再點「提交」。