Logo

Programming-Idioms

History of Idiom 120 > diff from v20 to v21

Edit summary for version 21 by programming-idioms.org:
[Go] +DocURL

Version 20

2016-04-07, 08:21:51

Version 21

2016-05-29, 13:37:12

Idiom #120 Read integer from stdin

Read an integer value from the standard input into variable n.

Idiom #120 Read integer from stdin

Read an integer value from the standard input into variable n.

Imports
import "fmt"
Imports
import "fmt"
Code
fmt.Scan(&n)
Code
fmt.Scan(&n)
Doc URL
https://golang.org/pkg/fmt/#Scan
Demo URL
http://play.golang.org/p/LyKGMHch7R
Demo URL
http://play.golang.org/p/LyKGMHch7R