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

class BigInt {
    static const int base = 10;
    public:
    deque<int> digits;
    BigInt() {
    }
    BigInt operator +(BigInt x) {
        BigInt c;

        // add
        auto di = digits.begin(), xi = x.digits.begin();
        for (; di != digits.end() && xi != x.digits.end(); di++, xi++)
            c.digits.push_back(*di + *xi);

        // set rest
        if (di == digits.end())
            di = xi;
        for (; di != digits.end(); di++)
            c.digits.push_back(*di);

        // nomalize
        int carry = 0;
        for (int i = 0; i < c.size(); i++) {
            c.digits[i] += carry;
            carry = c.digits[i] / base;
            c.digits[i] %= base;
        }
        if (carry)
            c.digits.push_back(carry);

        return c;
    }
    int size() {
        return digits.size();
    }
    istream &read(istream &is) {
        digits.clear();
        cin.ignore();

        int s;
        while (s = cin.get(), isdigit(s))
            digits.push_front(s - '0');
        is.putback(s);

        return is;
    }
    ostream &write(ostream &os) {
        for (auto di = digits.rbegin(); di != digits.rend(); di++)
            cout << *di;
        return os;
    }
};

istream &operator>>(istream &is, BigInt &b) { return b.read(is); }
ostream &operator<<(ostream &os, BigInt &b) { return b.write(os); }

int main()
{
    for (int n; cin >> n;)
        for (BigInt a, b, c; n-- && cin >> a >> b;) {
            c = a + b;
            if (c.size() < 80)
                cout << c << endl;
            else
                cout << "overflow" << endl;
        }

    return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
using namespace std;

int main(){
	int n;
	cin>>n;
	rep(i,0,n){
		int ans[85]={},n1[81]={},n2[81]={};
		string s1,s2;
		cin>>s1>>s2;
		int sz1=s1.size(),sz2=s2.size();

		rep(j,0,sz1) n1[j]=s1[sz1-1-j]-'0';
		rep(j,0,sz2) n2[j]=s2[sz2-1-j]-'0';

		for(int j=0;j<81;j++){
			//cout<<"  "<<j<<" "<<n1[j]<<n2[j]<<endl;
			int a=ans[j]+n1[j]+n2[j];
			ans[j]=a%10;
			ans[j+1]=a/10;
			//cout<<" "<<j<<" "<<ans[j]<<endl;
		}
		if(ans[80]>0){
			cout<<"overflow"<<endl; return 0;
		}
		bool f=0;
		for(int i=80;i>=0;i--){
			if(f==0 && ans[i]>0){
				f=1; cout<<ans[i];
			}else if(f) cout<<ans[i];
		}
		cout<<endl;
	}
}

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

int main()
{
	char  input1[1001]={0},input2[1001]={0};
	int   output[1002]={0};
	int lengs1=0,lengs2=0,lengs3=0,lengs4=0,count;
	
	scanf("%d",&count);

	for(int c=0;c<count;c++)
	{
		int i,j=1,k;
		for(k=0;k<1000;k++)
		{
			input1[k]=0;
			input2[k]=0;
			output[k]=0;
		}
		scanf("%s",&input1);
		scanf("%s",&input2);

		lengs1=strlen(input1);
		lengs2=strlen(input2);

		if(lengs1>80 || lengs2>80)
		{
			printf("overflow");
			continue;
		}

		lengs3=(lengs1>=lengs2)?lengs1+1:lengs2+1;
		lengs4=lengs3;
		while(lengs3>=0 && lengs1>=0 && lengs2>=0)
		{
			output[lengs3]+=(input1[lengs1--]-'0')+(input2[lengs2--]-'0');
			if(output[lengs3]>=10)
			{
				output[lengs3]%=10;
				output[lengs3-1]+=1;
			}
			lengs3--;
		}

		if(lengs1>=0||lengs2>=0)
		{
			while(lengs1>=0)
			{
				output[lengs3]+=(input1[lengs1--]-'0');
				if(output[lengs3]>=10)
				{
					output[lengs3]%=10;
					output[lengs3-1]+=1;
				}
				lengs3--;
			}
			while(lengs2>=0)
			{
				output[lengs3]+=(input2[lengs2--]-'0');
				if(output[lengs3]>=10)
				{
					output[lengs3]%=10;
					output[lengs3-1]+=1;
				}
				lengs3--;
			}
		}
		if(lengs4>80)
		{
			printf("overflow");
			continue;
		}
		if(output[0]!=0)
			j=0;
		for(i=j;i<lengs4;i++)
		{
			printf("%d",output[i]);
		}
		printf("\n");
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
 
signed main(){
int a;
cin>>a;
for(int b=0;b<a;b++){
    int goukei[81]{};
    char c[110]{},d[110]{};
    scanf("%s%s",c,d);
    int e,f;
    e=strlen(c);f=strlen(d);
    e--;f--;
    if(e>80||f>80)puts("overflow");
    for(int g=80;g!=0;g--,e--,f--){
	int s=0;
	if(e>-1)s+=c[e]-48;
	if(f>-1)s+=d[f]-48;
	goukei[g-1]=s/10;
	goukei[g]+=s%10;
	}
	if(goukei[0])puts("overflow");
	else{
	    bool ss=false;
	    for(int m:goukei){
		if(m)ss=true;
		if(ss)printf("%d",m);
		}
	    }
	    puts("");
    }
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
#include <string.h>
using namespace std;

#define FOR(i,s,e) for (int i = int(s); i != int(e); i++)
#define REP(i,e) for (int i = 0; i != int(e); i++)
#define FORIT(i, A) for (auto i : A)
#define ISEQ(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << endl
#define SZ(x) ((int)(x).size())

int main(int argc, char const *argv[])
{
	int n;
	scanf("%d", &n);
	REP(i, n)
	{
		char buf1[101], buf2[101];
		memset(buf1, 0, 101);
		memset(buf2, 0, 101);
		char sum[101];
		memset(sum, 0, 101);
		scanf("%s", buf1);
		scanf("%s", buf2);
		int l, l1 = 0, l2 = 0;
		for (l = 0; l < 100; l++)
		{
			if (buf1[l] == '\0' && l1 == 0)
			{
				l1 = l;
			}
			if (buf2[l] == '\0' && l2 == 0)
			{
				l2 = l;
			}
			if (l1 > 0 && l2 > 0) break;
		}
		l1--;
		l2--;
		l = (l1 > l2) ? l1 : l2;
		if (l >= 80)
		{
			printf("overflow\n");
			continue;
		}
		l++;
		bool plus = false;
		for (;l >= 0; l--)
		{
			int v1 = (l1 >= 0) ? buf1[l1] - '0': 0;
			int v2 = (l2 >= 0) ? buf2[l2] - '0': 0;
			int v = v1 + v2 + ((plus) ? 1 : 0);
			if (v > 9) 
			{
				plus = true;
				v -= 10;
			}
			else
			{
				plus = false;
			}
			sum[l] = '0' + v;
			l1--;
			l2--;
			if (l1 < 0 && l2 < 0 && !plus) break;
		}
		if (sum[0] == '\0')
		{
			printf("%s\n", &sum[1]);
		}
		else if (sum[80] != 0)
		{
			printf("overflow\n");
		}
		else
		{
			printf("%s\n", sum);
		}
	}
	return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<functional>
#include<queue>
#include<stack>
#include<math.h>
#define INF 999999
#define EPS 1.0e-6

using namespace std;

typedef long long ll;

int n;
string a;
string b;

int main()
{
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		cin >> a;
		cin >> b;
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());

		if (a.length() > 80 || b.length() > 80) {
			cout << "overflow" << endl;
			continue;
		}

		string ans;
		int alen = a.length();
		int blen = b.length();
		if (alen > blen) {
			for (int i = 0; i < alen - blen; i++) {
				b += '0';
			}
		}
		else {
			for (int i = 0; i < blen - alen; i++) {
				a += '0';
			}
		}

		int k = 0;
		for (int i = 0; i < a.length(); i++) {
			int ai = a[i] - '0';
			int bi = b[i] - '0';
			int ci = ai + bi + k;
			ans += ci % 10 + '0';
			k = ci / 10;
		}
		if (k != 0)ans += k+'0';
	
		if (ans.length() > 80) {
			cout << "overflow" << endl;
			continue;
		}
		reverse(ans.begin(), ans.end());
		for (int i = 0; i < ans.length(); i++) {
			cout << ans[i];
		}
		cout << endl;
	}

	
	return 0;
}