HDU:1090 的 python3 和 golang 实现()

python3

def hdu_1090():
    a = int(input(""))
    while a != 0:
        s = input("input")
        s1 = s.split(" ")
        print(int(s1[0])+int(s1[1]))
        a -= 1


if __name__ == "__main__":
    hdu_1090()

go

 package main

import (
	"fmt"
)

func main() {
	var a, b, c int
	_, _ = fmt.Scan(&c)  
	for {
		_, _ = fmt.Scan(&a, &b)
		c = c - 1
		if c == 0 {
			break
		}
		fmt.Println(a + b)
	}
}
————————

python3

def hdu_1090():
    a = int(input(""))
    while a != 0:
        s = input("input")
        s1 = s.split(" ")
        print(int(s1[0])+int(s1[1]))
        a -= 1


if __name__ == "__main__":
    hdu_1090()

go

 package main

import (
	"fmt"
)

func main() {
	var a, b, c int
	_, _ = fmt.Scan(&c)  
	for {
		_, _ = fmt.Scan(&a, &b)
		c = c - 1
		if c == 0 {
			break
		}
		fmt.Println(a + b)
	}
}