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>
#include <chrono>
using namespace std;

using _i64 = int64_t;
using _u64 = uint64_t;
using _f64 = double;

#define endl "\n"

#define _for(i, start, end) for(_i64 i = (_i64)start; i < (_i64)end; ++i)
#define _rep(i, number) _for(i, 0, number)
#define _foreach(e, data) for(auto& e : data)
#define _all(data) data.begin(), data.end()

template<typename type>
_i64 _size(const type& data) { return static_cast<_i64>(data.size()); }
template<typename type, size_t size>
_i64 _size(const type (&)[size]) { return static_cast<_i64>(size); }

enum _flag : bool { able = true, disable = false };

struct _time {
    _time(_flag flag) { check = flag; if(!check) { return; } gettime(start); }
    ~_time() {
        if(!check) { return; }; gettime(end);
        _i64 elapse = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cout << endl << "Time: " << elapse << " ms" << endl;
    }
    private:
    using _timer = chrono::time_point<chrono::system_clock>;
    _timer start, end; bool check;
    void gettime(_timer& time) { time = chrono::system_clock::now(); }
};

struct _ini { _ini() { ios::sync_with_stdio(false); cin.tie(nullptr); } } _ini;

#include <boost/multiprecision/cpp_int.hpp>

namespace boost_mp = boost::multiprecision;

int main() {
    {
        _time time(disable);
        _i64 N; boost_mp::cpp_int data1, data2; cin >> N;
        const boost_mp::cpp_int max = boost_mp::pow((boost_mp::cpp_int)10, 80);
        _rep(i, N) {
            cin >> data1 >> data2;
            if(data1 + data2 < max) { cout << data1 + data2 << endl; }
            else { cout << "overflow" << endl; }
        }
    }
    return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <utility>
#include <complex>
#include <stack>

using namespace std;

typedef complex<double> P;

int main(){

	int t;
	cin>>t;
	while(t--){
		string s,t;
		cin>>s>>t;
		int len = (int)max(s.size(),t.size());
		reverse(s.begin(),s.end());
		reverse(t.begin(),t.end());
		string ans;

		bool f = false;
		for (int i = 0; i < len; i++)
		{
			char add = 0;
			if(f){
				add++;
				f = false;
			}
			add += (i < (int)s.size()) ? s[i] - '0' : 0;
			add += (i < (int)t.size()) ? t[i] - '0' : 0;
			if(add >= 10){
				add -= 10;
				f = true;
			}
			ans.push_back(add + '0');
		}
		if(f)
			ans.push_back('1');

		reverse(ans.begin(),ans.end());

		if(ans.length() >= 80){
			cout << "overflow" << endl;
		}else {
		cout << ans << 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, j, n;
  int len1, len2;
  char tmp;

  scanf("%d",&n);
  rep(i,n){
    string str1, str2, res;
    cin >> str1;
    cin >> str2;

    vector<int> a(100, 0), b(100, 0);
    len1 = (int)str1.size(); len2 = (int)str2.size();
    rep(j,len1) a[j] = str1[(int)len1-1-j] - '0';
    rep(j,len2) b[j] = str2[(int)len2-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());
    int f = 0;
    rep(j,res.size()){
      if(res[j] != '0') f = 1;
      if(f && res.size()-j > 80){
        cout << "overflow" << endl;
        return 0;
      }
      if(f) cout << res[j];
    }

    cout << endl;
  }

  return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<memory.h>
using namespace std;

int n;
char a[85],b[85],answer[86];
char aa[85],bb[85];
int na=0,nb=0;

int main()
{
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		na=0,nb=0;
		//配列aa(bb)を'0'で初期化
		fill(aa,aa+85,'0');
		fill(bb,bb+85,'0');
		fill(a,a+85,0);
		fill(b,b+85,0);
		fill(answer,answer+85,0);
		scanf("%s%s",a,b);
		for(int i=0;a[i]!='\0';i++)
		{
			na++;
		}
		for(int i=0;b[i]!='\0';i++)
		{
			nb++;
		}
		//配列a(b)を右詰めでaa(bb)に収納する
		memcpy(aa+85-na,a,sizeof(char)*na);
		memcpy(bb+85-nb,b,sizeof(char)*nb);
		//以下足し算
		for(int j=84;j>=0;j--)
		{
			answer[j]+=aa[j]+bb[j]-'0';
			//繰り上げ
			if(answer[j]>'9')
			{
				answer[j-1]++;
				answer[j]-=10;
			}
		}
		int count=0;
		for(int j=0;(j<84)&&answer[j]=='0';j++)
		{
			count++;
		}
		if(count<5)
		{
			printf("overflow\n");
		}
		else
		{
		answer[85]='\0';//文字列終了のお知らせ
		memcpy(answer,answer+count,85-count+1);
		//出力
		printf("%s\n",answer);
		}
	}
}

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

int main(){
	string s1, s2;
	int n, n1[100], n2[100];cin >> n;
	for(int g = 0;g < n;g++){
		int f = 0;
		cin >> s1 >> s2;
		for(int i = 0;i < 100;i++)n1[i] = n2[i] = 0;
		if(s1.size()>80 || s2.size()>80)f = 1;
		if(!f){
		for(int i = 0;i < s1.size();i++)n1[i] = s1[s1.size()-i-1] - '0';
		for(int i = 0;i < s2.size();i++)n2[i] = s2[s2.size()-i-1] - '0';
		
		for(int i = 0;i < 90;i++){
			n1[i] += n2[i];
			if(n1[i] > 9){n1[i] = n1[i]%10;n1[i+1]++;}
		}
		int flag = 0;
		for(int i = 90;i >= 0;i--){
			if(flag && i >= 80){f = 1;break;}
			if(flag)cout << n1[i];
			if(!flag && i > 0 && n1[i-1] != 0)flag = 1;
		}
		if(!f)cout << endl;
		}
		if(f)cout << "overflow" << endl;
	}
	return 0; 
}