Read numbers from os.Stdin into array or slice in Go

前端 未结 0 364
后悔当初
后悔当初 2020-12-21 03:21

I can read multiple numbers using multiple variables like bellow.

numbers := make([]int, 2)
fmt.Fscan(os.Stdin, &numbers[0], &numbers[1])


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题