Created
January 28, 2015 02:52
-
-
Save junichiro/70b36d7f8f1213427d18 to your computer and use it in GitHub Desktop.
code_iq: 1239
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
package main | |
import ( | |
"fmt" | |
"os" | |
) | |
func main() { | |
v := GetInput() | |
fmt.Println(v) | |
} | |
func GetInput() [4][4]int { | |
var v[4][4]int | |
l := 0 | |
for { | |
var a[4]int | |
i, err := fmt.Scanf("%d,%d,%d,%d\n", &a[0], &a[1], &a[2], &a[3]) | |
if i == 4 { | |
for r := 0; r < 4; r++ { | |
v[l][r] = a[r] | |
} | |
} else if i == 0 { | |
break | |
} else { | |
fmt.Fprintln(os.Stderr, err) | |
os.Exit(1) | |
} | |
l++ | |
} | |
return v | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment