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<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	int cnt, m;
	cin >> cnt;
	string s1, s2, ans;
	for(int i = 0; i < cnt; i++){
		cin >> s1 >> s2;
		ans = "";
		m = max(s1.size(), s2.size());
		while( s1.size() < m ) 
			s1 = '0' + s1;
		while( s2.size() < m )
			s2 = '0' + s2;		
		int c = 0;	
		for(int i = m-1; i >= 0; i--){
			char ch = ((s1[i] - '0') + (s2[i] - '0') + c) % 10 + '0';
			c = ((s1[i] - '0') + (s2[i] - '0') + c) / 10;
			ans += ch;
		}		
		if(c) 
			ans += c + '0';
		reverse(ans.begin(), ans.end());
		while(ans.size() > 1 && ans[0] == '0') 
			ans.erase(ans.begin());		
		if(ans.size() > 80)
			cout << "overflow" << endl;
		else
			cout << ans << endl;
	}
}

C++: #include<vector>
#include<list>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  int i,j;
  int a,n,slen,tlen;
  string s,t;
  string *u;
  cin>>n;
  u=new string[n];
  for(i=0;i<n;i++){
    cin>>s>>t;
    slen=s.length();
    tlen=t.length();
    if(slen>80||tlen>80)
      u[i]="overflow";
    else{
      u[i]="00000000000000000000000000000000000000000000000000000000000000000000000000000000";
      a=0;
      for(j=0;j< (slen>tlen?slen:tlen) ;j++){
	if((j<slen?s[slen-j-1]:'0')+(j<tlen?t[tlen-j-1]:'0')+a-'0'-'0'>9){
	  u[i][79-j]=(j<slen?s[slen-j-1]:'0')+(j<tlen?t[tlen-j-1]:'0')+a-'0'-10;
	  a=1;
	}else{
	  u[i][79-j]=(j<slen?s[slen-j-1]:'0')+(j<tlen?t[tlen-j-1]:'0')+a-'0';
	  a=0;
	}  
      }
      if(j==80&&a)
	u[i]="overflow";
      else
	u[i][79-j]=a+'0';
    }
  }
  for(i=0;i<n;i++){
    if(u[i]=="overflow")
      cout<<u[i]<<endl;
    else{
      for(j=0;j<79&&u[i][j]=='0';j++);
      for(;j<80;j++)
	cout<<u[i][j];
      cout<<endl;
    }
  }
  return 0;
}

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(itr,c) 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, n;

  cin >> n;
  while(n--){
    int fix = 0;
    string s1, s2, tmp, res;

    cin >> s1;
    if((int)s1.size() > 80) fix++;
    cin >> s2;
    if((int)s2.size() > 80) fix++;

    vector<int> a(100,0);
    rep(i,s1.size()) a[i] = s1[(int)s1.size()-1-i] - '0';
    vector<int> b(100,0);
    rep(i,s2.size()) b[i] = s2[(int)s2.size()-1-i] - '0';

    rep(i,100){
      int sum = a[i] + b[i];
      if(sum >= 10){ sum %= 10; a[i+1]++;}
      tmp += sum + '0';
    }

    reverse(tmp.begin(), tmp.end());
    bool f = false;
    rep(i,tmp.size()){
      if(tmp[i] != '0') f = true;
      if(f) res += tmp[i];
    }

    if((int)res.size() > 80) fix++;
    if(fix) cout << "overflow" << endl;
    else cout << res << endl;
  }

  return 0;
}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <climits>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <vector>
#include <queue>
#include <string>
#include <complex>
using namespace std;

#define rep(i,n) for(int i=0; i<n; i++)
#define repa(i,s,e) for(int i=s; i<=e; i++)
#define repd(i,s,e) for(int i=s; i>=e; i--)

typedef vector<int> vi;

int n;
string s1, s2;
char n1[80], n2[80], sum[80];

int main() {
	scanf("%d", &n);
	rep(i,n) {
		memset(n1, 0, sizeof(n1));
		memset(n2, 0, sizeof(n2));
		memset(sum, 0, sizeof(sum));

		cin>>s1>>s2;
		int l1 = s1.size();
		int l2 = s2.size();
		if(max(l1,l2) > 80) {
			printf("overflow\n");
			continue;
		}

		rep(k,l1) n1[k] = s1[l1-k-1] - '0';
		rep(k,l2) n2[k] = s2[l2-k-1] - '0';

		char a = 0;
		rep(i,80) {
			char c = n1[i] + n2[i] + a;
			a = c / 10;
			sum[i] = c % 10;
		}

		if(a != 0) {
			printf("overflow\n");
			continue;
		}

		bool start = false;
		repd(i,79,0) {
			if(sum[i] != 0) start = true;
			if(!start && sum[i] == 0) continue;
			printf("%d", sum[i]);
		}
		if(!start) printf("0");
		printf("\n");
	}
}

C++: #include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int N=in();
	REP(i,N){
		string S=in<string>();
		reverse(ALL(S));
		string T=in<string>();
		reverse(ALL(T));
		int SN=S.size(),TN=T.size();
		if(SN>TN){
			REP(j,SN-TN) T.push_back('0');
		}
		else{
			REP(j,TN-SN) S.push_back('0');
		}
		SN=S.size();
		if(SN>80){
			out("overflow");
			continue;
		}
		bool flag = SN==80?true:false,overflow=false;
		string R(SN+1,'0');
		REP(j,SN){
			int v=(S[j]-'0')+(T[j]-'0')+(R[j]-'0');
			if(v>9){
				if(j==SN-1 && flag){
					overflow = true;
					break;
				}
				R[j+1] = '1';
				R[j] = (v-10)+'0';
			}
			else R[j] = v+'0';
		}
		if(overflow){
			out("overflow");
		}
		else{
			reverse(ALL(R));
			auto itr=find_if(ALL(R),[](char ch){return ch!='0';});
			if(itr==R.end()) --itr;
			while(itr!=R.end()){
				cout << *itr;
				++itr;
			}
			cout << endl;
		}
	}

	return 0;
}