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 <vector>
#include <cstdio>
#define N 10000
using namespace std;

char s[N];
vector<int> a,b;
int n, an,bn;

void pr( vector<int> a ){
  unsigned int i=0, len;
  while( a[i]==0 ) i++;

  len = a.size()-i;
  //  cout << "length : "<< len << endl;
  if( len>80 ){
    cout << "overflow";
  }else{
    for( ;i<a.size();i++ )
      cout << a[i];
  }
  cout << endl;
}

int main(){
  cin >> n;
  fgets( s,N,stdin );
  for( int loop=0;loop<n;loop++ ){
    a.clear();
    fgets( s,N,stdin );
    
    for( int i=0; s[i]!='\n' ;i++ )
      a.push_back( s[i]-'0' );
    b.clear();
    fgets( s,N,stdin );
    for( int i=0;s[i]!='\n';i++ )
      b.push_back( s[i]-'0' );
    an=a.size(); bn=b.size();

    while( an>bn ){
      b.insert( b.begin(),1, 0 ); bn++;
    }
    while( an<bn ){
      a.insert( a.begin(),1, 0 ); an++;
    }
    //    pr(a);
    //    pr(b);
    a.insert( a.begin(),1,0 );
    b.insert( b.begin(),1,0 );
    for( int i=an;i>=0;i-- ){
      a[i]+=b[i];
      if( a[i]>=10 ){
	a[i]-=10; a[i-1]++;
      }
    }
    pr( a );
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
#include <map>
#include <fstream>
#include <array>
#include <utility>
#include <functional>
#include <stack>

using namespace std;
typedef long long Int;
#define REP(i , x) for(Int i = 0 ; i < x ; ++i)

typedef pair<int, int> P;


int main()
{
	int n;
	cin >> n;
	REP(i, n){
		string a, b;
		int a_a[100] = { 0 };
		int b_a[100] = { 0 };
		int c_a[100] = { 0 };
		cin >> a >> b;

		vector<char> a_b(a.rbegin(), a.rend());
		vector<char> b_b(b.rbegin(), b.rend());

		if (a_b.size() > 80 || b_b.size() > 80){
			cout << "overflow" << endl;
			continue;
		}

		int carry(0);
		vector<int> ans;

		if (a_b.size() > b_b.size()){
			b_b.resize(a_b.size(), '0');
		}
		else{
			a_b.resize(b_b.size(), '0');
		}

		REP(i, a_b.size()){
			int temp = a_b[i] - '0' + b_b[i] - '0' + carry;
			carry = temp / 10;
			ans.push_back(temp % 10);
		}

		if (carry)
			ans.push_back(carry);

		if (ans.size() > 80){
			cout << "overflow" << endl;
			continue;
		}

		for (unsigned i = 0; i < ans.size(); i++) {
			cout << ans[ans.size() - 1 - i];
		}

		cout << endl;
	}

	return 0;
}

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

class largeInt{
public:
	largeInt() : digit( 0 ){
		initNum();
	}
	~largeInt(){}

	void set( const string& s ){
		numStr = s;
		initNum();
		digit = numStr.size();
		StoI();
	}
	const char* getFigure(){ return numStr.c_str(); }
	const int getDigit(){ return digit; }

	void operator+=( const largeInt& a ){
		numStr = "";
		for ( int i = 0; i < 10; ++i ){
			num[ i ] += a.num[ i ];
			if ( num[ i ] / 100000000 && i != 9 ){
				num[ i ] -= 100000000;
				num[ i + 1 ] += 1;
			}
			int t = num[ i ];
			string s;
			for ( int j = ( i == 9 ? 8 : 7 ); j >= 0; --j ){
				int power = static_cast< int >( pow( 10.0, static_cast< double >( j ) ) );
				int c = t / power;
				t %= power;
				s += static_cast< char >( c + '0' );
			}
			numStr = s + numStr;
			if ( i == 9 ){
				string::iterator it = numStr.begin();
				while ( ( *it == '0' ) && ( it != numStr.end() - 1 ) ){
					it = numStr.erase( it );
				}
			}
		}
		digit = numStr.size();
	}

private:
	void initNum(){
		for ( int i = 0; i < 10; ++i ){
			num[ i ] = 0;
		}
	}
	void StoI(){
		bool f = false;
		for ( int i = 0; i < digit / 8; ++i ){
			for ( int j = 0; j < 8; ++j ){
				if ( i*8 + j >= digit ){
					f = true;
					break;
				}else{
					conv( i, j );
				}
			}
			if ( f ) break;
		}
		for ( int i = 0; i < digit % 8; ++i ){
			conv( digit / 8, i );
		}
	}
	void conv( int i, int j ){
		int figure = static_cast< int >( numStr[ ( digit - 1 ) - ( i*8 + j ) ] - '0' );
		int power = static_cast< int >( pow( 10.0, static_cast< double >( j ) ) );
		num[ i ] += figure * power;
	}

	unsigned num[10];
	int digit;
	string numStr;
};

int main(){
	int n;
	string s;

	cin >> n;

	largeInt* a = new largeInt[ n ];
	largeInt* b = new largeInt[ n ];

	for ( int i = 0; i < n; ++i ){
		cin >> s;
		a[ i ].set( s );
		cin >> s;
		b[ i ].set( s );
	}

	for ( int i = 0; i < n; ++i ){
		a[ i ] += b[ i ];
		cout << ( a[ i ].getDigit() > 80 ? "overflow" : a[ i ].getFigure() ) << endl;
	}

	delete[] a;
	delete[] b;

	return 0;
}