Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	const maxCapacity = 512 * 1024
	buf := make([]byte, maxCapacity)
	scanner.Buffer(buf, maxCapacity)

	n := nextInt()
	maxint, _ := new(big.Int).SetString("100000000000000000000000000000000000000000000000000000000000000000000000000000000", 10)

	for i := 0; i < n; i++ {
		aStr := nextString()
		bStr := nextString()

		a, _ := new(big.Int).SetString(aStr, 10)
		b, _ := new(big.Int).SetString(bStr, 10)
		c := big.NewInt(0).Add(a, b)

		if c.Cmp(maxint) < 0 {
			fmt.Println(c)
		} else {
			fmt.Println("overflow")
		}
	}
}

C++: #include <bits/stdc++.h>

//const static double	de_PI	= 3.14159265358979323846;
//const static int	de_MOD	= 1000000007;
//const static int	de_MAX	= 999999999;
//const static int	de_MIN = -999999999;

inline std::string Add_MultiplePrecision(const std::string A, const std::string B) {

	int a[200] = {0};
	int b[200] = {0};
	int c[300] = {0};

	for (unsigned int i = 0; i < A.length(); i++) {
		a[i] = A[A.length() - 1 - i] - '0';
	}
	for (unsigned int i = 0; i < B.length(); i++) {
		b[i] = B[B.length() - 1 - i] - '0';
	}

	int carry = 0;
	for (unsigned int i = 0; i < std::max(A.length(), B.length()); i++) {
		c[i] = (a[i] + b[i] + carry) % 10;
		c[i + 1] = carry = (a[i] + b[i] + carry) / 10;
	}

	int st = 299;
	while (c[st] == 0) {
		st--;
	}

	std::string ans;
	for (int i = st; i >= 0; i--) {
		ans += std::to_string(c[i]);
	}

	if (ans == "") {
		ans = "0";
	}

	return ans;
}

int main(void) {

	//std::ifstream in("123.txt");	std::cin.rdbuf(in.rdbuf());

	int n = 0;
	std::cin >> n;
	std::vector<std::string> ans;

	std::string temp1, temp2, temp3;
	while (std::cin >> temp1) {
		std::cin >> temp2;
		temp3 = Add_MultiplePrecision(temp1, temp2);
		if (temp3.length() >= 80) {
			ans.push_back("overflow");
		}
		else {
			ans.push_back(temp3);
		}
	}

	for (unsigned int i = 0; i < ans.size(); i++) {
		std::cout << ans[i] << std::endl;
	}
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cstring>
#include <functional>

using namespace std;

#define REP(i,a,b) for((i)=(a);(i)<(int)(b);(i)++)
#define rep(i,n) REP(i,0,n)
// BEGIN CUT HERE
//#define foreach(c,itr) for(typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
//template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
// END CUT HERE

int main(){
  int i, j, n;

  scanf("%d",&n);
  rep(i,n){
    string str1, str2, res;
    cin >> str1;
    cin >> str2;
/*
    vector<int> a(82, 0), b(82, 0);
    rep(j,str1.length()){
      a[j] = str1[str1.length()-1-j] - '0';
      b[j] = str2[str2.length()-1-j] - '0';
    }

    rep(j,81){
      int sum = a[j] + b[j];
      if(sum >= 10){ sum %= 10; a[j+1]++;}
      res += (sum + '0');
    }

    reverse(res.begin(), res.end());
    bool f = false;
    rep(j,res.length()){
      if(res[j] != '0') f = true;
      if(f) cout << res[j];
    }
  */
    cout << endl;
  }

  return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  int n;
  cin >>n;
  while(n--){
    string a,b;
    cin >>a>>b;
    int num[900] = {0},tab = 0,i = 0;
    int as = a.size()-1;
    int bs = b.size()-1;
    int nmi = min(as,bs);
    int nma = max(as,bs);
    for(int x; i<=nma; i++){
      if(i<=nmi){x = tab+a[as-i]+b[bs-i]-'0'*2;}
      else if(as<bs){x = tab+b[bs-i]-'0';}
      else if(bs<as){x = tab+a[as-i]-'0';}
      tab = x/10;
      num[i] = x%10;
    }
    if(tab){num[nma+1] = tab;i++;}
    if(i>80){cout <<"overflow";}
    else{for(int x=i-1; x>=0; x--){cout <<num[x];}}
    cout <<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdlib>
#include<stdio.h>

int inttostring(char *x,int n){
  return sprintf(x,"%d",n);
}

int main(){
  std::string a;
  std::string b;
  char sum[102];
  int num_a,num_b;
  long long int num_sum,size_sum;
  int n;

  std::cin >> n;

  for(int i=0;i<n;i++){
    std::cin >> a >> b;
    num_a = std::atoi(&a[0]);
    num_b = std::atoi(&b[0]);

    num_sum = num_a+num_b;
    //sum = std::to_string(num_sum);

    size_sum = inttostring(sum,num_sum);

    if(size_sum>80){
      std::cout << "overflow" << std::endl;
      break;
    }

    std::cout << sum << std::endl;
  }
  //std::cout << num_a << std::endl;
  //std::cout << num_b << std::endl;
}

C++: 
#include <iostream>
#include <string>
#include <vector>
#include <utility> 
#include <tuple>
#include <algorithm>
#include <map>
#include <math.h>
using namespace std;


int main() {
int n;
cin>>n;
for(int y=0;y<n;y++){
string s,t;
cin>>s>>t;
	int ls=s.size(),lt=t.size();
if(ls>80||lt>80) cout<<"overflow"<<endl;
else{
	if(ls>lt){
		int r=ls-lt;
		while(r>0){
			t="0"+t;
		r=r-1;
		}
	}
	if(lt>ls){
		int r=-ls+lt;
		while(r>0){
			s="0"+s;
		r=r-1;
		}
	}
	
	int l=s.size();
	int q=0;
	string ans="";
	for(int k=0;k<l;k++){
		int w=t[l-k-1]-'0'+s[l-k-1]-'0';
		w=w+q;
//		cout<<w<<endl;
		char z='0'+w%10;
		ans=z+ans;
		q=w/10;
	}
	if(q==1) ans='1'+ans;
	if(q>0 && l==80)cout<<"overflow"<<endl;
	else 	cout<<ans<<endl;
	

}
	
	


}
	return 0;
}

C++: #include<iostream>
#include<string>

using namespace std;

int maxLength(const int &len1, const int &len2) {
	return len1 > len2 ? len1 : len2;
}


int main()
{
	int N;

	cin >> N;

	for (int i = 0; i < N; i++) {
		string s1, s2;
		cin >> s1 >> s2;
		//cout << s1 << endl << s2 << endl;
		int len1 = s1.size();
		int len2 = s2.size();
		int max = maxLength(len1, len2);
		if (max > 80) {
			cout << "overflow" << endl;
			continue;
		}

		int str[100] = {0};
		int acc = 0;
		for (int i = 0; i < max; i++) {
			if (len1 > i && len2 > i) {
				str[i] = (s1[len1-1-i] - '0') + (s2[len2-1-i] - '0') + acc;
			}
			else if(len1 > i) {
				str[i] = (s1[len1 - 1 - i] - '0') + acc;
			}
			else if (len2 > i) {
				str[i] = (s2[len2 - 1 - i] - '0') + acc;
			}
			acc = 0;
			if (str[i] > 9) {
				acc = 1;
				str[i] %= 10;
			}
		}
		if (max == 80 && acc == 1) {
			cout << "overflow" << endl;
			continue;
		}

		str[max] = acc;

		for (int i = acc == 1? max:max-1; i > -1; i--) {
			cout << str[i];
		}
		cout << endl;
	}

	return 0;
}