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 "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"


int main() {
	int N; cin >> N;
	while (N--) {

		string a, b; cin >> a >> b;
		vector<int>v(101);
		for (int i = 0; i < a.size(); ++i) {
			v[101 - a.size() + i] = a[i] - '0';
		}
		for (int i = 0; i < b.size(); ++i) {
			v[101 - b.size() + i] += b[i] - '0';
		}
		for (int i = 100; i >= 0; --i) {
			if (v[i] >= 10) {
				v[i - 1]++;
				v[i] -= 10;
			}
		}
		int num = 0;
		num = find_if(v.begin(), v.end(), [](const int a) {return a; })-v.begin();
		if (num <= 20)cout << "overflow" << endl;
		else {
			for (int i = num; i < 101; ++i) {
				cout << v[i];
			}
			cout << endl;
		}
	}
	return 0;
}

C++: // AOJ 0015
#include<algorithm>
#include<iostream>
#include<string>
#define rep(i,a) for( int i = 0; i != (a); ++i )

int N;
std::string a, b;

int main()
{
	std::cin >> N;
	while( N-- )
	{
		std::cin >> a >> b;
		std::reverse( a.begin(), a.end() );
		std::reverse( b.begin(), b.end() );

		int asz = a.size(), bsz = b.size(), sz = std::max( asz, bsz );

		a.resize( 80 );
		b.resize( 80 );

		std::string ans;
		int c = 0;
		rep( i, sz )
		{
			if( i >= asz )
				a[i] = '0';
			if( i >= bsz )
				b[i] = '0';

			int t = int(a[i])+b[i]+c-2*'0';
			c = 0;
			
			if( t >= 10 )
				c = 1, t %= 10;
			ans += char(t+'0');
		}

		if( c )
			ans += '1';

		if( ans.size() > 80 )
			puts("overflow");
		else
		{
			rep( i, ans.size() )
				putchar( ans[ans.size()-1-i] );
			puts("");
		}
	}

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
	int T;
	cin >> T;
	while(T--){
		//char s[100] = "abc";
		string a,b;
		
		cin >> a >> b;
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());
		while( a.size() < 100 ) a += "0";
		while( b.size() < 100 ) b += "0";
		string ans = "";
		int carry = 0;
		for(int i = 0 ; i < 100 ; i++){
			int d = (a[i]-'0') + (b[i]-'0') + carry;
			ans += d % 10 + '0';
			carry = d / 10;
		}
		reverse(ans.begin(),ans.end());
		if(ans.find_first_not_of('0')<20){
			cout << "overflow" << endl;
			continue;
		}
		ans = ans.substr(ans.find_first_not_of('0') );
		
		cout << ans << endl;
	}
	
	return 0;
}

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

using namespace std;

int main() {
    int N;
    cin >> N;
    while(N--) {
        string s1, s2;
        cin >> s1 >> s2;

        char buf[81] = {0};
        int p1 = s1.size()-1, p2 = s2.size()-1, pb = 79;
        int carry = 0;
        while(p2 >= 0) buf[pb--] = s2[p2--];
        pb = 79;
        while(p1 >= 0) {
            int bd = buf[pb];
            if(bd > 0) bd -= '0';
            int d = s1[p1--]-'0' + bd + carry;
            carry = d / 10;
            d %= 10;
            buf[pb--] = d+'0';
        }
        if(pb == -1 && carry > 0) cout << "overflow" << endl;
        else {
            if(carry > 0) buf[pb--] = carry+'0';
            cout << (char*)(buf+pb+1) << endl;
        }
    }
    return 0;
}