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 <iostream>
#include <vector>
#include <cstring>
using namespace std;

int main(){
	int n;
	cin >> n;
	while( n-- > 0 ){
		string num1, num2;
		cin >> num1 >> num2;
		char sum[101];
		int degit = 0;
		for( int i = 0; i < 101; i++ ) sum[i] = '0';
		for( int i = 0; i < num1.size(); i++ ){
			sum[100-i] = num1[num1.size()-i-1];
		}
		int d;
		for( int i = 0; i < num1.size() || i < num2.size() || degit != 0; i++ ){
			int now;
			if( i < num2.size() ){
				now = (int)sum[100-i]-(int)('0') + (int)(num2[num2.size()-i-1]-(int)('0') + degit;
			}else{
				now = (int)sum[100-i]-(int)('0') + degit;
			}
			sum[100-i] = (char)(now%10)+'0';
			if( now >= 10 ) degit = 1;
			else degit = 0;
			d = i;
		}
		if( d < 80 ){
			for( int i = 100-d; i < 101; i++ ) cout << sum[i];
			cout << endl;
		}else{
			cout << "overflow" << endl;
		}
	}
}

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

int main(){

	int n;

	string a, b;
	char N1[80], N2[80];
	char sum[80], temp[81];
	string ans;

	cin >> n;

	for( int i=0;i<n;i++ ){

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

		cin >> b;

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

		for( int i=0;i<80;i++ ){
			N1[i] = -1; N2[i] = -1; sum[i] = 0;
		}

		for( int i=1;i<=a.length();i++ )
			N1[i] = a[a.length()-i] - '0';
		for( int i=1;i<=b.length();i++)
			N2[i] = b[b.length()-i] - '0';

		int over = 0;
		
		for( int i=0;i<80;i++ ){


			if( N1[i] == -1 && N2[i] == -1 ){
				if( over >= 10 ){
					sum[i] = over / 10;
					over = 0;
				}else
					sum[i] = -1;
				continue;
			}

			if( N1[i] != -1 )
				sum[i] += N1[i];
			if( N2[i] != -1 )
				sum[i] += N2[i];

			sum[i] += over / 10;

			over = floor((double)sum[i]/10)*10;

			sum[i] -= over;
			
		}

		if(over > 0)cout << "overflow" << endl;
		else{
			int j=0;
			for( int i=1;i<=80;i++ ){
				if( sum[80-i] >= 0 ){
					temp[j] = sum[80-i] + '0';
					j++;
					continue;
				}
				
			}
			temp[j] = '\0';

			cout << temp << endl;
		}

	}
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;


int main()
{
	int n;
	string buf1, buf2;
	vector<int> num1, num2;

	cin >> n;

	for ( int i = 0; i < n; i++ )
	{
		num1.clear();
		num2.clear();

		cin >> buf1;
		cin >> buf2;

		for ( unsigned int i = 0; i < buf1.size(); i++ )
		{
			num1.push_back( buf1[i] - '0' );
		}
		
		for ( unsigned int i = 0; i < buf2.size(); i++ )
		{
			num2.push_back( buf2[i] - '0' );
		}

		reverse( num1.begin(), num1.end() );
		reverse( num2.begin(), num2.end() );

		for ( unsigned int i = 0; i < num2.size(); i++ )
		{
			if ( i < num1.size() )
			{
				num1[i] += num2[i];
			}
			else
			{
				num1.push_back( num2[i] );
			}
		}

		for ( unsigned int i = 0; i < num1.size(); i++ )
		{
			if ( 10 <= num1[i] )
			{
				if ( i + 1 < num1.size() )
				{
					num1[i+1] += num1[i] / 10;
				}
				else
				{
					num1.push_back( num1[i] / 10 );
				}
				
				num1[i] %= 10;
			}
		}

		if ( num1.size() < 80 )
		{
			for ( vector<int>::reverse_iterator it = num1.rbegin(); it != num1.rend(); it++ )
			{
				cout << *it;
			}
		}
		else
		{
			cout << "overflow";
		}
		cout << endl;
	}

	return 0;
}

C++: //#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define IN(a, b, x) (a<=x&&x<b)
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
//#define int ll

signed main(void)
{
	int n;
	cin >> n;
	REP(i, n) {
		string s, t;
		cin >> s >> t;

		int dif = abs((int)s.size()-(int)t.size());
		//cout << "dif:" << dif << endl;
		string tmp = "";
		REP(i, dif) tmp += '0';
		//cout << tmp << endl;
		if(s.size() < t.size()) s = tmp + s;
		else t = tmp + t;
		//cout << s << " " << t << endl;

		bool flag = false;
		for(int i=t.size()-1; i>=0; --i) {
			int tmp = (t[i]-'0')+(s[i]-'0');
			if(flag) tmp++;
			flag = false;
			if(tmp >= 10) {tmp -= 10; t[i] = tmp+'0'; flag = true;}
			else {t[i] = tmp+'0';}
			//cout << t << endl;
		}
		if(flag) t = '1' + t;
		if(t.size() > 80) cout << "overflow" << endl;
		else cout << t << endl;
	}

	return 0;
}