Go: package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Scan()
	dataset, _ := strconv.Atoi(sc.Text())
	var firstdata *big.Int

	for i := 0; i < dataset*2; i++ {
		n := new(big.Int)
		sc.Scan()
		data, _ := n.SetString(sc.Text(), 10)

		if i%2 == 0 {
			firstdata = data
			continue
		}

		result := new(big.Int)
		if result := result.Add(data, firstdata); len(result.String()) > 80 {
			fmt.Println("overflow")
			continue
		} else {
			fmt.Println(result)
		}
	}
}

C++: #include<iostream>
#include<string>
#include<cstring>
using namespace std;
string S, T; int n, x[10000], a[10000], b[10000], cnt; char U[11] = "0123456789";
int main() {
	cin >> n;
	for (int times = 0; times < n; times++) {
		cin >> S >> T;
		memset(x, 0, sizeof(x));
		memset(a, 0, sizeof(a));
		memset(b, 0, sizeof(b));
		for (int i = 0; i < S.size(); i++) {
			for (int j = 0; j < 10; j++) {
				if (U[j] == S[i]) {
					a[S.size() - 1 - i] = j;
				}
			}
		}
		for (int i = 0; i < T.size(); i++) {
			for (int j = 0; j < 10; j++) {
				if (U[j] == T[i]) {
					b[T.size() - 1 - i] = j;
				}
			}
		}
		if (S.size() > 80 || T.size() > 80) {
			cout << "overflow" << endl; goto E;
		}
		for (int i = 0; i < 80; i++) {
			x[i] += (a[i] + b[i]) % 10;
			x[i + 1] += (a[i] + b[i]) / 10;
			if (x[i] >= 10) {
				x[i + 1] += x[i] / 10;
				x[i] %= 10;
			}
			if (x[i + 1] >= 10) {
				x[i + 2]++;
				x[i + 1] %= 10;
			}
		}
		cnt = 0;
		if (x[80] > 0) {
			cout << "overflow" << endl;
		}
		else {
			for (int i = 79; i >= 0; i--) {
				if (x[i] > 0 || i == 0) { cnt++; }
				if (cnt) { cout << x[i]; }
			}
			cout << endl;
		}
	E:;
	}
}

C++: #include<iostream>
#include<string>
#include<cstring>
using namespace std;

int main(){
	string s1,s2;
	int num;
	cin>>num;
	for(int j=0;j<num;j++){
		cin>>s1;
		cin>>s2;
		int size1=s1.size();
		int size2=s2.size();
		if(size1>80 || size2>80){
			cout<<"overflow"<<endl;
			return 0;
		}
		if(size1>size2){
			for(int a=0;a<(size1-size2);a++){
				s2='0'+s2;
			}
		}else if(size1<size2){
			for(int a=0;a<(size2-size1);a++){
				s1='0'+s1;
			}
		}
		string ans="";
		int plus=0;
		for(int i=size1-1;i>=-1;i--){
			if(i==-1){
				if(plus!=0){
					ans=(char)(plus+'0')+ans;
					continue;
				}else{
					continue;
				}
			}
			int alt=(s1[i]-'0')+(s2[i]-'0')+plus;
			if(alt>=10){
				ans=(char)(alt-10+'0')+ans;
				plus=alt/10;
			}else ans=(char)(alt+'0')+ans;
		}
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  int n; cin >> n;
  for(int i=0;i<n;i++) {
    string s1,s2;
    cin >> s1;
    cin >> s2;
    int s1_itr = s1.length() - 1;
    int s2_itr = s2.length() - 1;
    bool is_shift = false;
    int digit;
    vector<int> sum;
    while(s1_itr >= 0 || s2_itr >= 0) {
      digit = 0;
      if(s1_itr >= 0)
        digit += s1[s1_itr] - '0';
      if(s2_itr >= 0)
        digit += s2[s2_itr] - '0';
      if(is_shift)
        digit += 1;

      if(digit >= 10) {
        is_shift = true;
        digit = digit - 10;
      }
      else {
        is_shift = false;
      }
      sum.push_back(digit);
      s1_itr--;
      s2_itr--;
    }
    if(is_shift)
      sum.push_back(1);

    if(sum.size() >= 80) {
      cout << "overflow" << endl;
    }
    else {
      for(int i=sum.size()-1;i>=0;i--) {
        cout << sum[i];
      }
      cout << endl;
    }
  }
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;


int main(){

	int n;
	cin >> n;
	for(int i=0 ; i<n ; i++){
		string a, b;
		cin >> a;
		cin >> b;

		if(b.size() > a.size()){
			string temp;
			temp = a;
			a = b;
			b = temp;
		}

		if(a.size() > 80){
			cout << "overflow" << endl;
		}else{
			for(int j=0 ; j<b.size() ; j++){
				a[a.size()-1-j] = a[a.size()-1-j] + b[b.size()-1-j] -'0';
				if(a[a.size()-1-j] > '9'){
					a[a.size()-1-j] -= 10;
					for(int l=j+1 ; l<a.size() ; l++){
						a[a.size()-1-l] += 1;
						if(a[a.size()-1-l] <= '9'){
							break;
						}else{
							a[a.size()-1-l] -= 10;
							if((a.size()-1-l) == 0){
								a = '0' + a;
							}
						}
					}
				}
			}
			if(a.size() > 80){
				cout << "overflow" << endl;
			}else{
				cout << a << endl;
			}
		}

		}

	return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main() {
  int tcase;
  
  cin >> tcase;
  while(tcase--) {
    string A, B, C = "";
    cin >> A >> B;
    
    unsigned sz = max(A.size(), B.size());
    while(A.size()<sz) A = '0' + A;
    while(B.size()<sz) B = '0' + B;

    int c = 0;
    for(int i=sz-1; i>=0; i--) {
      // 確定情報
      C += ( (A[i]-'0') + (B[i]-'0') + c ) % 10 + '0';
      // 前座
      c = ( (A[i]-'0') + (B[i]-'0') + c ) / 10;
    }
    if(c>0) C += ( (A[sz-1]-'0') + (B[sz-1]-'0') + c ) % 10 + '0';
    
    reverse(C.begin(), C.end());
    cout << C << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cstdlib>
#include <stdint.h>
#include <cmath>
using namespace std;

int getNumberOfDigits(int64_t i)
{
    return i > 0 ? (int) log10(((double) i)) + 1 : 1;
}

int main()
{
    int iN;
    cin >> iN;
    int64_t sum, iA, iB;
    for(int c = 0; c < iN; c++)
    {
        cin >> iA;
        cin >> iB;
        sum = iA + iB;
        if(getNumberOfDigits(sum) > 80)
            cout << "overflow" << endl;
        else
            cout << sum << endl;
    }
    return EXIT_SUCCESS;
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#define MAX_LEN 101

using namespace std;

void q15() {
	int N;
	scanf("%d\n", &N);
	for (int n = 0; n < N; n++) {
		string a, b;
		getline(cin, a);
		getline(cin, b);

		if (a.length() < b.length()) {
			string tmp = a;
			a = b;
			b = tmp;
		}

		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());
		
		int carry = 0;
		string ans="";

		int i = 0;
		for (; i < b.length(); i++) {
			ans+= (((a[i] - '0') + (b[i] - '0') + carry) % 10) + '0';
			carry = ((a[i] - '0') + (b[i] - '0') + carry) / 10;
		}
		for (; i < a.length(); i++) {
			ans+= (((a[i] - '0') + carry) % 10) + '0';
			carry = ((a[i] - '0') + carry) / 10;
		}
		for (; carry; i++) {
			ans+= (carry % 10) + '0';
			carry = carry / 10;
		}

		reverse(ans.begin(), ans.end());
		cout << (ans.length() > 80 ? "overflow" : ans) << endl;
	}
}
int main() {
	q15();
	return 0;
}