As title, it's hard for me to describe the problem. So I showed the sample code, input and output below.
package main
import (
"fmt"
)
func main() {
for i := 1; i <= 3; i++ {
var a, b, c string
fmt.Scan(&a)
fmt.Scan(&b)
fmt.Scan(&c)
fmt.Printf("%s
", a)
}
}
Input
a b c
d e f
g h i
Expected Output
a
d
g
However, the actual output printed "a", "d" first. Then, after pressing return (enter) key, "g" was printed. This was actual output.
Update
If I pasted whole nine characters, the third iteration was hung. However, if I merely enter character one after another, it met the expected output.