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 <string>
using namespace std;
typedef vector <int> VI;

VI string_to_vi( string number )
{
	VI converted( number.size() );
	for ( int i = 0; i < number.size(); i++ ) converted[i] = (int)( number[i] - '0' );
	return converted;
}

VI add( VI left, VI right )
{
	VI result;
	reverse( left.begin(), left.end() );
	reverse( right.begin(), right.end() );
	VI::iterator it_left = left.begin();
	VI::iterator it_right = right.begin();

	int carry = 0;
	while ( it_left != left.end() || it_right != right.end() )
	{
		int l = 0, r = 0;
		if ( it_left != left.end() ) l = *it_left;
		if ( it_right != right.end() ) r = *it_right;

		result.push_back( ( l + r + carry ) % 10 );
		carry = ( l + r + carry >= 10 ) ? 1 : 0;

		if ( it_left != left.end() ) it_left ++;
		if ( it_right != right.end() ) it_right ++;
	}
	if ( carry ) result.push_back( 1 );

	reverse( result.begin(), result.end() );
	return result;
}

int main( void )
{
	int n; cin >> n;
	for ( int i = 0; i < n; i++ )
	{
		string input_a, input_b;
		cin >> input_a >> input_b;

		VI a = string_to_vi( input_a );
		VI b = string_to_vi( input_b );
		VI c = add( a, b );

		for ( VI::iterator it = c.begin(); it != c.end(); it++ ) cout << *it;
		cout << endl;
	}
	return 0;
}

C++: // includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a); i<(b);++i)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

// solve

int main(int argc, char const* argv[])
{
  int n;
  cin >> n;
  rep(i, n){
    string s, t;
    cin >> s >> t;
    reverse(s.begin(), s.end());
    reverse(t.begin(), t.end());
    string res = "";
    int tmp = 0;
    rep(i, max(s.size(), t.size())){
      int sn = 0, tn = 0;
      if(i < s.size())sn = int(s[i] - '0');
      if(i < t.size())tn = int(t[i] - '0');
      int num = tmp + sn + tn;
      tmp = num / 10;
      res += char('0' + (num % 10));
    }
    if(tmp > 0)res += char('0' + tmp);
    reverse(res.begin(), res.end());
    if(res.size() <= 80)cout << res << endl;
    else cout << "overflow" << endl;
  }
	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') {
    f = 1;
    return true;
  }
  scanf("%80s", str2);
  scanf("%c", &c);
  if ('0' <= c && c <= '9') {
    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 <iostream>
#include <queue>
#include <vector>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
using namespace std;

int main(){
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		string a, b;
		cin >> a;
		cin >> b;
		string result(80, '0');
		int over = 0;
		int j = a.length() - 1;
		int k = b.length() - 1;
		int l = 79;
		for (; l >= 0; --j, --k, --l) {
			int numa = j < 0 ? '0' : a[j];
			int numb = k < 0 ? '0' : b[k];
			int sum = numa + numb - '0' * 2 + over;
			if (sum >= 10) {
				over = 1;
				sum -= 10;
			} else {
				over = 0;
			}
			result[l] = sum + '0';
		}
		if (over == 1) {
			cout << "overflow" << endl;
		} else {
			int j = 0;
			for (; j < result.length() && result[j] == '0'; ++j);
			for (; j < result.length(); ++j) cout << result[j];
			cout << endl;
		}
	}

	return 0;
}