Go: package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	const maxCapacity = 512 * 1024
	buf := make([]byte, maxCapacity)
	scanner.Buffer(buf, maxCapacity)

	n := nextInt()
	maxint, _ := new(big.Int).SetString("100000000000000000000000000000000000000000000000000000000000000000000000000000000", 10)

	for i := 0; i < n; i++ {
		aStr := nextString()
		bStr := nextString()

		a, _ := new(big.Int).SetString(aStr, 10)
		b, _ := new(big.Int).SetString(bStr, 10)
		c := big.NewInt(0).Add(a, b)

		if c.Cmp(maxint) < 0 {
			fmt.Println(c)
		} else {
			fmt.Println("overflow")
		}
	}
}

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

C++: /*
 * Problem     : AOJ0015
 * Title       : Integral
 * Author      : mizo0203
 * Status      : Accepted
 * Date        : Sun Jun 24 20:50:52
 * Copyright   : Your copyright free
 * Description : 文字列・多倍長演算
 */

#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;

int N, f;
char str1[81], str2[81];
int sum[80];

void init() {
  scanf("%d", &N);
}

bool input() {
  char c;

  if (!N)
    return false;
  N--;

  f = 0;
  scanf("%80s", str1);
  scanf("%c", &c);
  if ('0' <= c && c <= '9') {
    while ('0' <= c && c <= '9') scanf("%c", &c);
    f = 1;
  }
  scanf("%80s", str2);
  scanf("%c", &c);
  if ('0' <= c && c <= '9') {
    while ('0' <= c && c <= '9') scanf("%c", &c);
    f = 1;
    return true;
  }

  return true;
}

int main() {
  int i;

  init();
  while (input()) {
    if (f) {
      printf("overflow\n");
      continue;
    }
    fill(sum, sum + 80, 0);
    for (i = 0; i < (int) strlen(str1); i++) {
      sum[i] = str1[strlen(str1) - i - 1] - '0';
    }
    f = 0;
    for (i = 0; i < (int) strlen(str2); i++) {
      sum[i] += str2[strlen(str2) - i - 1] - '0' + f;
      f = 0;
      if (sum[i] > 9) {
        sum[i] -= 10;
        f = 1;
      }
    }
    for (; i < 80; i++) {
      sum[i] += f;
      f = 0;
      if (sum[i] > 9) {
        sum[i] -= 10;
        f = 1;
      }
    }
    if (f) {
      printf("overflow\n");
      continue;
    }
    for (i = 0; i < 79; i++) {
      if (sum[79 - i] != 0)
        break;
    }
    for (; i < 80; i++) {
      printf("%d", sum[79 - i]);
    }
    printf("\n");
  }

  return 0;
}

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

using namespace std;

#define REP(i,a,b) for((i)=(a);(i)<(int)(b);(i)++)
#define rep(i,n) REP(i,0,n)
// BEGIN CUT HERE
//#define foreach(c,itr) for(typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
//template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
// END CUT HERE

int main(){
  int i, j, n;

  scanf("%d",&n);
  rep(i,n){
    string str1, str2, res;
    cin >> str1;
    cin >> str2;

    vector<int> a(82, 0), b(82, 0);
    rep(j,str1.length()){
      a[j] = str1[str1.length()-1-j] - '0';
      b[j] = str2[str2.length()-1-j] - '0';
    }
/*
    rep(j,81){
      int sum = a[j] + b[j];
      if(sum >= 10){ sum %= 10; a[j+1]++;}
      res += (sum + '0');
    }

    reverse(res.begin(), res.end());
    bool f = false;
    rep(j,res.length()){
      if(res[j] != '0') f = true;
      if(f) cout << res[j];
    }
  */
    cout << endl;
  }

  return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<string.h>
#include<stdlib.h>
#include<math.h>

using namespace std;

int main(){
	int n;
	string ret1,ret2;
	vector<int> result;
	int num = 0, ret = 0;
	int j;

	cin >> n;

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

		ret = 0;

		cin >> ret1 >> ret2;


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

		for (j = 1;j <= ret1.size() && j <= ret2.size();j++){
			num = (ret1.at(ret1.size() - j) - '0' + ret2.at(ret2.size() - j) - '0' + ret) % 10;
			ret = (ret1.at(ret1.size() - j) - '0' + ret2.at(ret2.size() - j) - '0' + ret);
			ret = (ret - num)/10;
			//cout << "ret:" << ret << endl;
			result.push_back(num);
		}

		if (ret1.size() == ret2.size()){
			if (ret != 0)
				result.push_back(ret);
		}
		else if(ret1.size() > ret2.size()){
			for (; j <= ret1.size(); j++){
				num = (ret1.at(ret1.size() - j) - '0' + ret) % 10;
				ret = ret1.at(ret1.size() - j) - '0' + ret;
				ret = (ret - num) / 10;
				//cout << "ret:" << ret << endl;
				result.push_back(num);
			}
			if (ret != 0)
				result.push_back(ret);
		}
		else if (ret1.size() < ret2.size()){
			for (; j <= ret2.size(); j++){
				num = (ret2.at(ret2.size() - j) - '0' + ret) % 10;
				ret = ret2.at(ret2.size() - j) - '0' + ret;
				ret = (ret - num) / 10;
				//cout << "ret:" << ret << endl;
				result.push_back(num);
			}
			if (ret != 0)
				result.push_back(ret);
		}

		if (result.size() > 80){
			cout << "overflow" << endl;
			while (result.empty() != true){
				result.pop_back();
			}
			continue;
		}


		while (result.empty() != true){
			cout << result[result.size()-1];
			result.pop_back();
		}
		cout << endl;

	}


	return 0;
}