Created
December 24, 2016 11:30
-
-
Save anonymous/999589f5fc30a41f2b04b9e182cdce61 to your computer and use it in GitHub Desktop.
競プロ Goで
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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