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 <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
	int n = 0;
	char i1[100], i2[100], o[100];
	int d1[81], d2[81], d[81];
	int c = 0;

	scanf("%d", &n);
	for(int i=0; i<n; ++i){
		scanf("%s", i1);
		scanf("%s", i2);
		if(strlen(i1) > 80 || strlen(i2) > 80){
			puts("overflow");
			continue;
		}
		for(int j=0;j<81;++j){
			d1[j] = d2[j] = d[j] = 0;
		}
		for(int j=strlen(i1)-1;j>=0;--j){
			d1[j] = *(i1 + j) - '0';
		}
		for(int j=strlen(i2)-1;j>=0;--j){
			d2[j] = *(i2 + j) - '0';
		}
		for(int j=0;j<81; ++j){
			d[j] = d1[j] + d2[j] + c;
			c = d[j] >= 10 ? 1 : 0;
			d[j] -= 10 * c;
		}
		for(c=80; c>=0; --c){
			if(d[c] != 0){
				break;
			}
		}
		if(c == 80){
			puts("overflow");
			continue;
		}
		for(int j = 0; j<=c; ++j){
			o[j] = d[c - j] + '0';
		}
		o[c + 1] = '\0';
		printf("%s\n", o);
	}
	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 i=0;i<n;i++)
	{
		string s1,s2;
		cin >> s1 >> s2;
		vector<int> ans;
		int k=0;
		for(int j=0;j<1000;j++)
		{
			int num=0;
			int a=s1.size()-1-j,b=s2.size()-1-j;
			if(a<0&&b<0&&k==0)break;
			if(a>=0)num+=s1[a]-'0';
			if(b>=0)num+=s2[b]-'0';
			ans.pb((num+k)%10);
			if(num+k>=10)k=1;
			else k=0;
		}
		if(ans.size()>80)
		{
			printf("overflow\n");
			continue;
		}
		for(int j=ans.size()-1;j>=0;j--)
		{
			cout << ans[j];
		}
		cout << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <stack>

using namespace std;

int main(void){
	stack <char> buffer;
	int a[80],n,i,j;
	char buffer2;
	cin >> n;
	scanf(" ");
	for (int i = 0; i < n; i++)
	{
		for(j=0;j<80;j++) a[j]=0;
		buffer2 = 0;
		for(j=0;;j++){
			scanf("%c",&buffer2);
			if(buffer2=='\n') break;
			if(j>=80) goto error;
			buffer.push(buffer2);
		}
		for(j=0;!buffer.empty();j++){
			a[j]+=buffer.top()-'0';
			buffer.pop();
		}
		buffer2 = 0;
		for(j=0;;j++){
			scanf("%c",&buffer2);
			if(buffer2=='\n') break;
			if(j>=80) goto error;
			buffer.push(buffer2);
		}
		for(j=0;!buffer.empty();j++){
			a[j]+=buffer.top()-'0';
			buffer.pop();
		}
		for(j=0;a[j]!=0;j++){
			if(a[j]>=10){a[j]-=10;a[j+1]++;}
		}
		for(j=79;a[j]==0;j--);
		for(;j>=0;j--){
			cout << a[j];
		}
		goto normal;
		error : cout << "overflow";
		normal : cout << endl;
	}
	return 0;
}

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

using namespace std;

void solve()
{
	int n;
	cin >> n;
	while(n--)
	{
		string a, b;
		cin >> a >> b;
		string l, s;
		a.size() >= b.size() ? (l = a, s = b) : (l = b, s = a);
		reverse(l.begin(), l.end());
		reverse(s.begin(), s.end());
		string sum;
		
		int sizel = l.size();
		int sizes = s.size();
		int buf = 0;
		for(int i = 0; i < sizes; ++i)
		{
			sum += (l[i] + s[i] - '0' - '0' + buf) % 10 + '0';
			buf = (l[i] + s[i] - 2 * '0' + buf) / 10;
		}
		for(int i = sizes; i < sizel; ++i)
		{
			sum += (l[i] - '0' + buf) % 10 + '0';
			buf = (l[i] - '0' + buf) / 10;
		}
		if(buf > 0)
		{
			sum += buf + '0';
		}
		int size = sum.size();
		if(size > 80)
		{
			cout << "overflow" << endl;
			continue;
		}
		for(int i = size - 1; i >= 0; --i)
		{
			cout << sum[i];
		}
		cout << endl;
	}
}

int main()
{
	solve();
	return(0);
}