A Plus B
Шешімді жөнелту
Ұпайлар:
5 (partial)
Уақыт шектеуі:
2.0s
Жад шектеуі:
64M
Author:
Problem types
Рұқсат етілген тілдер
Assembly, Awk, C, C++, Perl, Python
Tudor is sitting in math class, on his laptop. Clearly, he is not paying attention in this situation. However, he gets called on by his math teacher to do some problems. Since his math teacher did not expect much from Tudor, he only needs to do some simple addition problems. However, simple for you and I may not be simple for Tudor, so please help him!
Input Specification
The first line will contain an integer \(N\) (\(1 \le N \le 100\,000\)), the number of addition problems Tudor needs to do. The next \(N\) lines will each contain two space-separated integers whose absolute value is less than \(1\,000\,000\,000\), the two integers Tudor needs to add.
Output Specification
Output \(N\) lines of one integer each, the solutions to the addition problems in order.
Sample Input
2
1 1
-1 0
Sample Output
2
-1
Пікірлер
.
Если будете решать задачу, не делайте с выводом еще обычного текста для удобства пользователя, который будет использовать программу (что наврядли), иначе не засчитает.
Проще говоря этот неверный:
include <iostream>
int main() { long long n, a, b; std::cout << "Количество задач: "; std::cin >> n; for (int i = 0; i <= n; i++) { std::cout << "Задача " << i << std:: std::cout << "Введите A и B: "; std::cin >> a >> b; std::cout << "A+B=" << a+b << std::endl; } }
Этот верный
include <iostream>
int main() { long long n, a, b; std::cin >> n; for (int i = 0; i <= n; i++) { std::cin >> a >> b; std::cout << a+b << std::endl; } }
.
n,r = int(input()),[] for _ in range(n): a,b = map(int, input().split())