Skip to content

Instantly share code, notes, and snippets.

Created December 24, 2016 11:30
Show Gist options
  • Save anonymous/999589f5fc30a41f2b04b9e182cdce61 to your computer and use it in GitHub Desktop.
Save anonymous/999589f5fc30a41f2b04b9e182cdce61 to your computer and use it in GitHub Desktop.
競プロ Goで
import (
"strconv"
"strings"
"bufio"
"os"
)
var scanner = bufio.NewScanner(os.Stdin)
func readLine() string { scanner.Scan(); return scanner.Text() }
func scanVals(ys ...interface{}) {
xs := strings.Split(readLine(), " ")
pos := 0
for _, y := range ys {
switch v := y.(type) {
case *int:
v, _ = strconv.Atoi(xs[pos])
pos++
default:
v = xs[pos]
pos++
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment