Блог пользователя SS101440_Eesamurad

Автор SS101440_Eesamurad, история, 9 месяцев назад, По-английски

You are given two integers A and B. Your task is to compute their sum A + B and print the result.

However, there’s a twist! The numbers can be very large, so you must ensure your solution handles large inputs efficiently.

Input: The first line contains a single integer T (1 ≤ T ≤ 1000) — the number of test cases.

Each of the next T lines contains two integers A and B (−10^18 ≤ A, B ≤ 10^18).

Output: For each test case, print the sum A + B on a new line.

Examples: Input:

text 3 5 7 -10 20 1000000000000000000 1000000000000000000 Output:

text

  • Проголосовать: нравится
  • -15
  • Проголосовать: не нравится

»
9 месяцев назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

What?

#include <iostream>

using namespace std;

int main()
{
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int T; cin>>T; while(T--)
    {
        long long a, b; cin>>a>>b;
        cout<<a+b<<'\n';
    }
    return 0;
}