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 <vector>
#include<string>
#include<sstream>

#define CAPACITY 9

 
namespace stoi{
 
    int stoi(std::string str){
        int ret;
        std:: stringstream ss;
        ss << str;
        ss >> ret;
        return ret;
    }
 
}
class OverDigit
{
public:
    int num_a[CAPACITY];
    int num_b[CAPACITY];
    OverDigit(std::string str_a, std::string str_b);
    void ChangeDigit(std::string str,int num[]);
    void Add();
};
 
OverDigit::OverDigit(std::string str_a,std::string str_b)
{
    ChangeDigit(str_a, num_a); 
    ChangeDigit(str_b, num_b);
}

void OverDigit::ChangeDigit(std::string str, int num[])
{
	std::vector <int> num_str(CAPACITY, 0);
    int loc = CAPACITY, k = 8;
    int str_Max, str_rest;

    str_Max = str.length() / CAPACITY;//
    str_rest = str.length() % CAPACITY;


	for (int j = str.length() - CAPACITY; str_Max > 0; j = j-CAPACITY)
	{
        num_str[0/*k*/] = stoi::stoi(str.substr(j, CAPACITY));
        loc = k;
        k--;
        str_Max--;
    }

    if(str_rest!=0)
	{
		num_str[loc - 1] = stoi::stoi(str.substr(0, str_rest));
	}
 
    for (int j = 0; j < CAPACITY; j++)
	{
		num[j]=num_str[j];
    }
}

void OverDigit::Add()
{
    int num_ans[CAPACITY] = {};
    int fat,overflow=0,count=0;
 
    for (int j = CAPACITY-1; j >0; j--)
	{
        if (num_a[j] + num_b[j]<=999999999)
		{
            num_ans[j] = num_a[j] + num_b[j];
        }
        else
		 if (num_a[j] + num_b[j] > 999999999)
		{
            fat = (num_a[j] + num_b[j]) - 1000000000;
            num_ans[j] = fat;
            num_a[j - 1]++;     
        }
    }

    if (num_a[0] + num_b[0] > 99999999)
	{
        overflow = 1;
    }
    else
	{
		 num_ans[0]= num_a[0] + num_b[0];
    }
 
    if (overflow == 1)
	{
        std::cout << "overflow" << std::endl;
    }
    else
	{
        for (int j = 0; j < CAPACITY; j++)
		{
            if (num_ans[j] != 0)
			{
                count++;
                std::cout << num_ans[j];
            }
            else
			 if (num_ans[j] == 0 && count >= 1)
			{
                std::cout << "000000000";
            }
        }
		std::cout << std::endl;
    }
}
 
 
int main(){
    int N;
    std::string str_a, str_b;
 
    std::cin >> N;
    std::cin.ignore();
 
   for (int i = 0; i < N; i++){
        getline(std::cin, str_a);
        getline(std::cin, str_b);
        OverDigit OverDigit_a(str_a,str_b);
       OverDigit_a.Add();
   }
 
    return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
typedef pair<int,int> pint;
#define rep(i,n) for(int i=0;i<n;i++)
#define F first
#define S second
int dx[]={1,-1,0,0},dy[]={0,0,1,-1};

int N;

int f(string s1,string s2,int x){
	if(N>80){cout<<"overflow"<<endl;return 0;}
	if(s1.size()<=N&&s2.size()<=N&&x==0)return 0;
	if(s1.size()>N)x+=s1[s1.size()-N-1]-'0';
	if(s2.size()>N)x+=s2[s2.size()-N-1]-'0';
	++N;
	f(s1,s2,x/10);
	if(N<=80)cout<<x%10;
	return 0;
}

int main(){
	int n;
	cin>>n;
	rep(i,n){
		N=0;
		string s1,s2;
		cin>>s1>>s2;
		f(s1,s2,0);
		cout<<endl;
	}
	cout<<endl;
	return 0;
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"


int main() {
	int N; cin >> N;
	while (N--) {

		string a, b; cin >> a >> b;
		vector<int>v(101);
		for (int i = 0; i < a.size(); ++i) {
			v[101 - a.size() + i] = a[i] - '0';
		}
		for (int i = 0; i < b.size(); ++i) {
			v[101 - b.size() + i] += b[i] - '0';
		}
		for (int i = 100; i >= 0; --i) {
			if (v[i] >= 10) {
				v[i - 1]++;
				v[i] -= 10;
			}
		}
		int num = 0;
		num = find_if(v.begin(), v.end(), [](const int a) {return a; })-v.begin();
		if (num <= 20)cout << "overflow" << endl;
		else {
			for (int i = num; i < 101; ++i) {
				cout << v[i];
			}
			cout << endl;
		}
	}
	return 0;
}

C++: // AOJ 0015
#include<algorithm>
#include<iostream>
#include<string>
#define rep(i,a) for( int i = 0; i != (a); ++i )

int N;
std::string a, b;

int main()
{
	std::cin >> N;
	while( N-- )
	{
		std::cin >> a >> b;
		std::reverse( a.begin(), a.end() );
		std::reverse( b.begin(), b.end() );

		int asz = a.size(), bsz = b.size(), sz = std::max( asz, bsz );

		a.resize( 80 );
		b.resize( 80 );

		std::string ans;
		int c = 0;
		rep( i, sz )
		{
			if( i >= asz )
				a[i] = '0';
			if( i >= bsz )
				b[i] = '0';

			int t = int(a[i])+b[i]+c-2*'0';
			c = 0;
			
			if( t >= 10 )
				c = 1, t %= 10;
			ans += char(t+'0');
		}

		if( c )
			ans += '1';

		if( ans.size() > 80 )
			puts("overflow");
		else
		{
			rep( i, ans.size() )
				putchar( ans[ans.size()-1-i] );
			puts("");
		}
	}

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
	int T;
	cin >> T;
	while(T--){
		//char s[100] = "abc";
		string a,b;
		
		cin >> a >> b;
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());
		while( a.size() < 100 ) a += "0";
		while( b.size() < 100 ) b += "0";
		string ans = "";
		int carry = 0;
		for(int i = 0 ; i < 100 ; i++){
			int d = (a[i]-'0') + (b[i]-'0') + carry;
			ans += d % 10 + '0';
			carry = d / 10;
		}
		reverse(ans.begin(),ans.end());
		if(ans.find_first_not_of('0')<20){
			cout << "overflow" << endl;
			continue;
		}
		ans = ans.substr(ans.find_first_not_of('0') );
		
		cout << ans << endl;
	}
	
	return 0;
}

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

using namespace std;

int main() {
    int N;
    cin >> N;
    while(N--) {
        string s1, s2;
        cin >> s1 >> s2;

        char buf[81] = {0};
        int p1 = s1.size()-1, p2 = s2.size()-1, pb = 79;
        int carry = 0;
        while(p2 >= 0) buf[pb--] = s2[p2--];
        pb = 79;
        while(p1 >= 0) {
            int bd = buf[pb];
            if(bd > 0) bd -= '0';
            int d = s1[p1--]-'0' + bd + carry;
            carry = d / 10;
            d %= 10;
            buf[pb--] = d+'0';
        }
        if(pb == -1 && carry > 0) cout << "overflow" << endl;
        else {
            if(carry > 0) buf[pb--] = carry+'0';
            cout << (char*)(buf+pb+1) << endl;
        }
    }
    return 0;
}