任务: You are making a robot that can speak numbers. Your robot should take 3 numbers in the range of 0-10 as input and output the corresponding texts in English.
预解决方案:演示
func main() {
num := 0
var input int
for i := 0; i < 10; i++ {
num += 1
switch num {
case 1:
fmt.Println("One")
case 2:
fmt.Println("Two")
case 3:
fmt.Println("Three")
case 4:
fmt.Println("Four")
case 5:
fmt.Println("Five")
case 6:
fmt.Println("Six")
case 7:
fmt.Println("Seven")
case 8:
fmt.Println("Eight")
case 9:
fmt.Println("Nine")
case 10:
fmt.Println("Ten")
}
}
}
问题:如何运行循环 3 次?更多详情: https://www.sololearn.com/learning/eom-project/1164/1188
翻阅古今
largeQ
相关分类