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<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

int c[100];

void add(char*a, char*b)  //鮟倩ョ、a豈巴髟ソ
{
    fill(c,c+100,0);      //蜥檎噪蜷?ス咲スョ髮カ
    int la=strlen(a), lb=strlen(b);
        for(int i=la,j=lb;i>la-lb&&j>0;i--,j--) // 菫晉蕗c豈泌刈謨ー譛?柄荳イ螟壻ク?ス?        {
            c[i]+=a[i-1]-'0'+b[j-1]-'0';
            if(c[i]>9)
            {
                c[i]-=10;
                c[i-1]++;
            }
        }
        for(int i=la-lb;i>0;i--)
        {
            c[i]+=a[i-1]-'0';
            if(c[i]>9)
            {
                c[i]-=10;
                c[i-1]++;
            }
        }
        if(la==80&&c[0]==1) printf("overflow\n");
        else
        {
            if(c[0]==0)
            {
                for(int i=1;i<=la;i++)
                    printf("%d",c[i]);
                printf("\n");
            }
            else
            {
                for(int i=0;i<=la;i++)
                   printf("%d",c[i]);
                printf("\n");
            }
        }
}

int main()
{
    char a[100], b[100];
    int n;
    scanf("%d",&n);

    while(n--){
    scanf("%s%s",a,b);
    int la = strlen(a), lb = strlen(b);
    if(la>80 || lb>80)
        printf("overflow\n");
    else if(la>lb)
        add(a,b);
    else add(b,a);
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <sstream>
using namespace std;
string toStr(int n) {
    ostringstream os; os << n;
    return os.str();
}
string add(string a, string b) {
    while (a.size() > b.size()) b = "0" + b;
    while (b.size() > a.size()) a = "0" + a;
    string res = "";
    int carry = 0;
    for (int i=a.size()-1; i>=0; --i) {
        int t = (a[i] - '0') + (b[i] - '0') + carry;
        res = toStr(t % 10) + res;
        carry = t / 10;
    }
    if (carry) res = "1" + res;

    return (res.size() <= 80) ? res : "overflow";
}
int main() {
    int n; cin >> n;
    string a, b;
    while (n--) {
        cin >> a >> b;
        cout << add(a, b) << endl;
    }
    return 0;
}

C++: #include <stdio.h>

#define N 80

// Longint <- String
void init(int a[], char s[]);
// a <- b + c
int add(int a[], int b[], int c[]);
// print Longint
void print(int a[]);

int main(void){
	int n;
	int a[N], b[N], sum[N];
	char s[101];
	
	for (int i=0; i<n; i++){
		scanf("%s", s);
		init(a, s);
		scanf("%s", s);
		init(b, s);
		if (add(sum, a, b)==-1){
			puts("overflow");
		} else {
			print(sum);
		}
	}
	return 0;
}

// Longint <- String
void init(int a[], char s[]){
	int len=0;
	
	for (int i=0; i<N; i++) a[i] = 0;
	for (char *p=s; *p!='\0'; p++) len++;
	for (int i=0; s[i]!='\0'; i++){
		a[N-len+i] = s[i] - '0';
	}
}
// a <- b + c
int add(int a[], int b[], int c[]){
	int cry=0;
	for (int i=N-1; i>=0; i--){
		a[i] = b[i]+c[i]+cry;
		cry = a[i]/10;
		a[i] %= 10;
	}
	return cry ? -1 : 0;
}

// print Longint
void print(int a[]){
	int i;
	for (i=0; i<N && a[i]==0; i++)
	;
	if (i==N){
		puts("0");
		return;
	} else {
		for (; i<N; i++){
			printf("%d", a[i]);
		}
		puts("");
	}
}

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

using namespace std;

int main() {
	int N; cin >> N;
	for (int i=0; i<N; i++) {
		string a, b;
		cin >> a >> b;
		int sum, ret=0;
		if (a.length() > b.length()) {
			int l = b.length()-1;
			for (int i=a.length()-1; i>=0; i--) {
				if (l >= 0) {
					sum = (a[i]-48)+(b[l]-48)+ret;
					l--;
				} else {
					sum = (a[i]-48)+ret;
				}
				if (sum>=10) {
					ret = sum/10;
					sum -= ret*10;
				} else {
					ret = 0;
				}
				a[i] = sum+48;
			}
			if (ret != 0) {
				a.insert(a.begin(), ret+48);
			}
			if (a.length() > 80) cout << "overflow" << endl;
			else cout << a << endl;
		} else {
			int l = a.length()-1;
			for (int i=b.length()-1; i>=0; i--) {
				if (l >= 0) {
					sum = (a[i]-48)+(b[i]-48)+ret;
					l--;
				} else {
					sum = (a[i]-48)+ret;
				}
				if (sum>=10) {
					ret = sum/10;
					sum -= ret*10;
				} else {
					ret = 0;
				}
				b[i] = sum+48;
			}
			if (ret != 0) {
				b.insert(b.begin(), ret+48);
			}
			if (b.length() > 80) cout << "overflow" << endl;
			else cout << b << endl;
		}
	}
	return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
int main()
{
	int n;
	cin >> n;
	for(int j=0;j<n;j++)
	{
		string s1,s2;
		vector<int> ans;
		cin >> s1;
		cin >> s2;
		reverse(s1.begin(),s1.end());
		reverse(s2.begin(),s2.end());
		int k=0;
		int p=max(s1.size(),s2.size());
		int len1=s1.size(),len2=s2.size();
		s1.resize(p+2);
		s2.resize(p+2);
		for(int i=len1;i<p+2;i++)
		{
			s1[i]='0';
		}
		for(int i=len2;i<p+2;i++)
		{
			s2[i]='0';
		}
		ans.resize(p+2);
		for(int i=0;i<p+2;i++)
		{
			ans[i]=((s1[i]-'0')+(s2[i]-'0')+k)%10;
			if((s1[i]-'0')+(s2[i]-'0')+k>=10)k=1;
			else k=0;
		}
		vector<int>::iterator it=ans.end();
		it--;
		int r=0;
		while(*it==0)
		{
			ans.erase(it);
			r++;
			it--;
		}
		ans.resize(p+2-r);
		reverse(ans.begin(),ans.end());
		if(ans.size()>80)
		{
			printf("overflow\n");
			continue;
		}
		for(int i=0;i<ans.size();i++)
		{
			cout << ans[i];
		}
		cout << endl;
	}
	return 0;
}