Golang解法
package main import ( "fmt" "io" ) func main() { var a, b int for { _, err := fmt.Scanf("%d %d", &a, &b) if err == io.EOF { break } fmt.Println(a + b) } }
package main import ( "fmt" "io" ) func main() { var a, b int for { _, err := fmt.Scanf("%d %d", &a, &b) if err == io.EOF { break } fmt.Println(a + b) } }
相关推荐