Go: package main

import (
        "fmt"
        "bufio"
        "os"
)

func main() {
        var n int
        var a, b string
        sc := bufio.NewScanner(os.Stdin)
        fmt.Scanf("%d", &n)
        for i := 0; i < n; i++ {
                sc.Scan()
                a = sc.Text()
                sc.Scan()
                b = sc.Text()

                if len(a) > len(b) {
                        s := add(a, b)
                        if s[len(a)] > 0 {
                                if len(a) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(a)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                } else {
                        s := add(b, a)
                        if s[len(b)] > 0 {
                                if len(b) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(b)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                }
        }
}

// expects ln > lm
func add(n string, m string) (s [100]int) {
        ln := len(n)
        lm := len(m)
        var sum [100]int

        for i := 0; i < ln; i++ {
                var s, t int
                s = int(n[ln-1-i]) - int('0')

                if lm - 1 - i >= 0 {
                        t = int(m[lm-1-i]) - int('0')
                } else {
                        t = 0
                }

                sum[i+1] = (s + t + sum[i]) / 10
                sum[i] = (s + t + sum[i]) % 10
        }

        return sum
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <fstream>

using namespace std;

typedef unsigned uint;
typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair
#define MSG(a) cout << #a << " = " << a << endl;
#define rep(i, n) for(int i = 0; i < n; i++)
#define All(v) v.begin(), v.end()

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }

int main()
{
	int n;
	cin >> n;
	rep(i, n)
	{
		int ans[128];
		memset(ans, 0, sizeof(ans));
		string a, b;
		cin >> a >> b;

		int ai = a.size()-1, bi = b.size()-1;
		for(int i = 0; ai >= 0 || bi >= 0; ai--, bi--, i++)
		{
			int as = (ai >= 0 ? a[ai] - '0' : 0), bs = (bi >= 0 ? b[bi] - '0' : 0);

			ans[i] += as + bs;
			ans[i+1] += max(0, ans[i] - 9);
			if(9 < ans[i]) ans[i] = 0;

			if(i == 100) break;
		}

		if(ans[80] != 0 ||(80 < a.size() || 80 < b.size()))
		{
			cout << "overflow" << endl;
			continue;
		}
		else
		{
			int index = 0;
			rep(i, 120)
				if(ans[i] != 0)
					index = i;

			for(int i = index; i >= 0; i--)
				cout << ans[i];

			cout << endl;
		}
	}
}

C++: #include <iostream>
#include <string>
#include <cstdlib>
#define x 81
using namespace std;

int main(){
	int n;
	cin >> n;
	cin.ignore();
	for(int i=0;i<n;i++){
		string a,b;
		getline(cin,a);
		getline(cin,b);
		bool c = false;
		if(a.size()>=x) c = true;
		if(b.size()>=x) c = true;
		int p[x];
		int k = 0;
		for(int j=0;j<x;j++){
			p[j] = k;
			int s = a.size()-j-1;
			int t = b.size()-j-1;
			string f;
			string g;
			if(s>=0) f = a.substr(s,1);
			if(t>=0) g = b.substr(t,1);
			if(s>=0) p[j] += atoi(f.c_str());
			if(t>=0) p[j] += atoi(g.c_str());
			if(p[j]>=10){ p[j] -= 10; k = 1; }
			else k = 0;
			if(k*j==79) c = true;
		}
		if(c) cout << "overflow" << endl;
		else{
			int d = x-1;
			while(p[d]==0){ d--; }
			for(int j=d;j>=0;j--) cout << p[j];
			cout << endl;
		}
	}
}

C++: #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string.h>
#include <queue>
#include <stack>
#include <utility>
#include <queue>
#define mp make_pair
#define pii pair<int,int> 
#define ff first
#define ss second

using namespace std;

int t,temp1,temp2,tempc;
char a[1000],b[1000];
int c[1000];

int addition(int n1,int n2)
{
	if(n1>=n2)
	{
		if(n2!=-1)
		{
			temp1=(int)a[n1]-48;
			temp2=(int)b[n2]-48;
			tempc=temp1+temp2;
			//printf("%d,%d,%d",temp1,temp2,tempc);
			if(tempc>=10)
			{
				tempc-=10;
				c[n1]+=1;
			}
			c[n1+1]+=tempc;
			//printf("%d,%d",c[n1+1],tempc);
			addition(n1-1,n2-1);
		}
		else if(n1!=-1)
		{
			tempc=(int)a[n1]-48;
			if(tempc+c[n1+1]>=10)
			{
				c[n1+1]-=10;
				c[n1]+=1;
			}
			c[n1+1]+=tempc;
			addition(n1-1,n2);
		}
	}
	else
	{
		addition(n2,n1);
	}
}

int main()
{
	scanf("%d",&t);
	while(t--)
	{
		scanf("%s",a);
		scanf("%s",b);
		for(int x=0;x<max(strlen(a),strlen(b))+5;x++)
		{
			c[x]=0;
		}
		if(strlen(a)>80||strlen(b)>80)
		{
			printf("overflow\n");
			continue;
		}
		else
		{
			addition(strlen(a)-1,strlen(b)-1);
			//printf("%d",(int)a[1]);
			//printf("%d,%d\n",strlen(a),strlen(b));
		}
		for(int z=0;z<max(strlen(a),strlen(b))+1;z++)
		{
			if(c[z]==0&&z==0)
			continue;
			printf("%d",c[z]);
		}
		printf("\n");
	}
	return 0;
}