SS101440_Eesamurad's blog

By SS101440_Eesamurad, history, 9 months ago, In English

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

  • Vote: I like it
  • -15
  • Vote: I do not like it

»
9 months ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

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;
}