Logo

Programming-Idioms

History of Idiom 120 > diff from v15 to v16

Edit summary for version 16 by :
[Go] Var name is n. It is given, needs not be declared.

Version 15

2016-02-18, 16:58:03

Version 16

2016-02-18, 18:57:40

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
var i int
fmt.Scan(&i)
Code
fmt.Scan(&n)
Demo URL
http://play.golang.org/p/LyKGMHch7R
Demo URL
http://play.golang.org/p/LyKGMHch7R