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

int main() {
	int n;cin>>n;
	string a,b;for(int j=0;j<n;j++){
	cin>>a>>b;
	int d=0;
	if(a.length()<b.length())
	{
		int aa=a.length();
		for(int i=0;i<b.length()-aa;i++)a='0'+a;
	}
	else
	{
		int bb=b.length();
		for(int i=0;i<a.length()-bb;i++)b='0'+b;
	}
	string ans="";
	for(int i=a.length()-1;i>=0;i--)
	{
		int aa=a[i]-'0';
		int bb=b[i]-'0';
		aa+=bb+d;d=0;
		if(aa>=10)
		{
			aa-=10;
			d++;
		}
		ans=char(aa+'0')+ans;
	}
	if(d)ans=char(d+'0')+ans;
	while(ans[0]=='0')
	{
		ans=ans.substr(1,ans.length()-1);
	}
	if(ans.length()>=80)cout<<"overflow"<<endl;
	else cout<<ans<<endl;}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <stack>
#include <utility>
#include <numeric>
#include <algorithm>
#include <functional>
#include <cctype>
#include <complex>
#include <string>
#include <sstream>

using namespace std;

#define all(c) c.begin(),c.end()
#define rall(c) c.rbegin(),c.rend()
#define rep(i,n) for(int i=0;i<(n);i++)
#define tr(it,container) for(typeof(container.begin()) it = container.begin(); \
                             it != container.end(); ++it)
#define mp(a,b) make_pair((a),(b))
#define eq ==

typedef long long ll;
typedef complex<double> point;

// up right down left
const int dy[] = {-1,0,1,0};
const int dx[] = {0,1,0,-1};

const double EPS = 1e-9;
const int days[]     = {31,28,31,30,31,30,31,31,30,31,30,31};
const int daysleap[] = {31,29,31,30,31,30,31,31,30,31,30,31};

int main(){
    int k;
    cin >> k;
    for(int kk = 0;kk<k;kk++){
        string a,b;
        cin >> a;
        cin >> b;

        string ret;

        int n = max(a.size()+1,b.size()+1);
        {
            stringstream ss;
            ss << setfill('0') << setw(n) << a;
            ss >> a;
        }
        {
            stringstream ss;
            ss << setfill('0') << setw(n) << b;
            ss >> b;
        }
        string c;
        c.resize(n);
        int up = 0;
        for(int i=a.size()-1;i>=0;i--){
            int now = a[i]-'0' + b[i]-'0' + up;
            if(now >= 10){
                up = now / 10;
                now -= 10;
            }else{
                up = 0;
            }
            c[i] = now+'0';
        }
        string s;
        for(int i=0;i<n;i++){
            if(c[i] != '0'){
                for(int j=i;j<n;j++){
                    s += c[j];
                }
                goto end;

            }
        }
    end:
        cout << s << endl;
    }
    return 0;
}

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

string findSum(string str1, string str2)
{
    if (str1.length() > str2.length())
        swap(str1, str2);

    string str = "";

    int n1 = str1.length(), n2 = str2.length();
    int diff = n2 - n1;

    int carry = 0;

    for (int i = n1 - 1; i >= 0; i--)
    {
        int sum = ((str1[i] - '0') +
                   (str2[i + diff] - '0') +
                   carry);
        str.push_back(sum % 10 + '0');
        carry = sum / 10;
    }

    for (int i = n2 - n1 - 1; i >= 0; i--)
    {
        int sum = ((str2[i] - '0') + carry);
        str.push_back(sum % 10 + '0');
        carry = sum / 10;
    }

    if (carry)
        str.push_back(carry + '0');

    string s_str = "";
    for (int i = str.length() - 1; i >= 0; i--)
    {
        s_str.push_back(str[i]);
        str[i] = '\0';
    }

    return s_str;
}

int main(void)
{
    int n;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        string a, b;
        cin >> a >> b;
        if (80 < a.length() || 80 < b.length())
        {
            cout << "overflow" << endl;
        }
        else
        {

            string s = findSum(a, b);
            if (80 < s.length())
            {
                cout << "overflow" << endl;
            }
            else
            {
                cout << s << endl;
            }
        }
    }
    return 0;
}

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

using namespace std;

int main(){
    string a, b;
    vector<int> ans;

    int n, num, ai, bi, c = 0;

    bool flag;

    cin >> n;
    while (n--){
	cin >> a >> b;
	flag = false;

	for (int j = 0; j < 100; j++){
	    num = 0;
	    ai = a.size() - j - 1;
	    bi = b.size() - j - 1;
	    if (ai < 0 && bi < 0 && c == 0) break;

	    if (ai >= 0) num += a[ai] - 48;
	    if (bi >= 0) num += b[bi] - 48;
	    ans.push_back((num+c) % 10);
	    if (num + c >= 10) c = 1;
	    else c = 0;
	}
	if (ans.size() > 80) flag = true;

	if (flag) puts("overflow");
	else {
	    for (int j = ans.size() - 1; j >= 0; --j) printf("%d\n", ans[j]);
	}
	ans.clear();
    }
    return 0;
}

C++: #include <iterator>
#include <typeinfo>
#include <list>
#include <map>     
#include <numeric>
#include <utility>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <iostream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define rep(a,t) for(int a=0;a<t;++a) 
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
#define pb push_back
#define int_maxvalue numeric_limits<int>::max()
ll mod = 1e9 + 7;
string Addition(string a,string b) {
	string ans = "";
	int bef = 0;
	int be1 = 0;
	for (int i = a.length() - 1; i >= 0; i--) {
		int added = stoi(a.substr(i, 1)) + stoi(b.substr(i, 1))+be1;

		if (added >= 10) {
			bef = 1;
			added -= 10;
		}
		else {
			bef = 0;
		}

		ans = to_string(added)+ans;
		/*/
		stringstream ss;
		ss << added;

		ans = ss.str() + ans;*/
		be1 = bef;
		if (i == 0)
		{
			break;
		}
	}
	if (be1 == 1) {
		ans = "1" + ans;
	}
	return ans;
}
int main() {
	int n;
	cin >> n;
	rep(o1, n) {
		string a, b;
		cin >> a >> b;
		if (a.length() < b.length()) {
			swap(a, b);
		}
		string b1 = b;
		for (int i = 0; i < a.length() - b1.length(); ++i) {
			b = '0' + b;
		}
		string ans = Addition(a, b);
		if (ans.length() > 80) { cout << "overflow" << endl; }
		else {
			cout << ans << endl;
		}
	}
	return 0;
}