题解 | #多组_A+B_EOF形式#
多组_A+B_EOF形式
https://www.nowcoder.com/practice/295063bf1bce4c2e819a8f18a5efcd20
package main import ( "fmt" "io" ) func main() { var a, b int for { _, err := fmt.Scan(&a, &b) if err == io.EOF { break } fmt.Println(a + b) } }
多组_A+B_EOF形式
https://www.nowcoder.com/practice/295063bf1bce4c2e819a8f18a5efcd20
package main import ( "fmt" "io" ) func main() { var a, b int for { _, err := fmt.Scan(&a, &b) if err == io.EOF { break } fmt.Println(a + b) } }
相关推荐