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 <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;

class lInt
{
private:
	vector<int> place;
public:
	lInt( string number )
	{
		for ( unsigned int i = 0; i < number.length(); i++ )
		{
			place.push_back( number[i] - '0' );
		}

		reverse( place.begin(), place.end() );

		return;
	}

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

		cout << endl;

		return;
	}

	void operator += ( string number )
	{
		vector<int> buffer;
		
		for ( unsigned int i = 0; i < number.length(); i++ )
		{
			buffer.push_back( number[i] - '0' );
		}
		reverse( buffer.begin(), buffer.end() );

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

				place[i] %= 10;
			}
		}
	}
};

int main()
{
	int n;
	string buffer;

	cin >> n;

	for ( int i = 0; i < n; i++ )
	{
		cin >> buffer;
		lInt li( buffer );
		cin >> buffer;
		li += buffer;

		li.printNumber();
	}

	return 0;
}

C++: #include <cstdio>

int myAbs(int num) { return (num > 0) ? num : -num ; }

int countNumberLength(char *data) {
	for (int i = 0;; i++) {
		if (data[i] == '\0')
			return i;
	}
	return 0;
}

void moveNumber(char *data, int diff, int length) {
	int idx = length;
	for (int i = 0; i < length+1; i++) {
		data[idx-i+diff] = data[idx-i];
	}
	for (int i = 0; i < diff; i++) {
		data[i] = '0';
	}
}

int chr2int(char chr) {
	int ret;
	switch (chr) {
	case '1':
		ret = 1;
		break;
	case '2':
		ret = 2;
		break;
	case '3':
		ret = 3;
		break;
	case '4':
		ret = 4;
		break;
	case '5':
		ret = 5;
		break;
	case '6':
		ret = 6;
		break;
	case '7':
		ret = 7;
		break;
	case '8':
		ret = 8;
		break;
	case '9':
		ret = 9;
		break;
	case '0':
		ret = 0;
		break;
	case 'X':
		ret = 10;
		break;
	
	}
	return ret;
}

const char int2chr[11] = {
	'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'X'
};

void makeSumNumber(char *left, char *right, char *sum, int length) {
	sum[length] = '\0';
	for (int i = length-1; i !=-1; i--) {
		int t_sum = chr2int(left[i]) + chr2int(right[i]);
		if (t_sum >= 10) {
			if (i != 0) {
				left[i-1] = int2chr[chr2int(left[i-1])+1];
				t_sum %= 10;
			}
		}
		sum[i] = int2chr[t_sum];
	}
}

int main(int argc, char *argv[]) {
	using namespace std;
	
	int dataN;
	fscanf(stdin, "%d", &dataN);
	
	for (int i = 0; i < dataN; i++) {
		char tmp1[100], tmp2[100], sum[100];
		int cnt1, cnt2, diff, longer;
		fscanf(stdin, "%s", tmp1);
		fscanf(stdin, "%s", tmp2);
		cnt1 = countNumberLength(tmp1);
		cnt2 = countNumberLength(tmp2);
		diff = myAbs(cnt1 - cnt2);
		
		// is Overflow
		if (cnt1 > 80 || cnt2 > 80) {
			puts("overflow");
		}
		else {
			//printf("%d:%s\n", cnt1, tmp1);
			//printf("%d:%s\n", cnt2, tmp2);
			if (cnt1 > cnt2) {
				longer = cnt1;
				// set tmp
				moveNumber(tmp1, 1, cnt1+1);
				moveNumber(tmp2, diff+1, cnt2+1);
				// get sum
				makeSumNumber(tmp1, tmp2, sum, cnt1+1);
			}
			else if (cnt1 < cnt2) {
				longer = cnt2;
				// set tmp
				moveNumber(tmp2, 1, cnt2+1);
				moveNumber(tmp1, diff+1, cnt1+1);
				// get sum
				makeSumNumber(tmp1, tmp2, sum, cnt2+1);
			}
			else {
				longer = cnt1;
				// set tmp
				moveNumber(tmp1, 1, cnt1+1);
				moveNumber(tmp2, 1, cnt2+1);
				// get sum
				makeSumNumber(tmp1, tmp2, sum, cnt1+1);
			}
			// after calc
			if (sum[0] == '0') {
				for (int i = 1; i < longer+2; i++) {
					sum[i-1] = sum[i];
				}
			}
			else {
				if (cnt1 >= 80 || cnt2 >= 80) {
					puts("overflow");
					continue;
				}
			}
			
			printf("%s\n", sum);
		}
	}
	return 0;
}