每组数据有两个整数
#include <iostream> using namespace std; int main() { int a, b, n_groups = 0; while (std::cin >> n_groups) { for (int i = 0; i <= n_groups - 1; i++) { std::cin >> a >> b; std::cout << a+b << std::endl; } } }
import sys 1. t = int(input()) for i in range(t): a,b = map(int,input().split()) print(a+b) 2. t = int(sys.stdin.readline()) for i in range(t): a,b=map(int,sys.stdin.readline().split()) sys.stdout.write(f"{a + b}\n")