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++: //#define _USE_MATH_DEFINES
#include <iostream>
#include <stdio.h>
//#include <iomanip>
#include <vector>
#include <string>
//#include <algorithm>
//#include <functional>
//#include <cmath>
//#include <time.h>

using namespace std;


int main(){

	int n, k1, k2, left, right, buf, flag;
	string s1, s2 , out;
	int aa1[10], aa2[10], ans[10];

	cin >> n;

	for (int i = 0; i < n; i++){
		for (int i = 0; i < 10; i++){
			aa1[i] = 0;
			aa2[i] = 0;
			ans[i] = 0;
		}
		flag = 0;

		cin >> s1 >> s2;
		k1 = s1.size();
		k2 = s2.size();

		if (k1 > 80 || k2 > 80){
			cout << "overflow" << endl;
		}
		else{
			buf = 8 - k1 % 8;
			for(int i = 0; i < buf; i++){
				s1.insert(0,"0");
			}
			buf = 8 - k2 % 8;
			for (int i = 0; i < buf; i++){
				s2.insert(0, "0");
			}
			left = s1.size()-8;
			for (int i = 0; i < 10; i++){
				aa1[i] = atoi(s1.substr(left, 8).c_str());
				left -= 8;
				if (left < 0)break;
			}
			left = s2.size() - 8;
			for (int i = 0; i < 10; i++){
				aa2[i] = atoi(s2.substr(left, 8).c_str());
				left -= 8;
				if (left < 0)break;
			}

			for (int i = 0; i < 10; i++){
				ans[i] += aa1[i] + aa2[i];
				if (ans[i] >= 100000000){
					ans[i + 1] += 1;
					ans[i] -= 100000000;
				}
			}
			if (ans[10] >= 100000000){
				cout << "overflow" << endl;
			}
			else{
				for (int i = 9; i >= 0; i--){
					if (flag == 0){
						if (ans[i] != 0){
							printf("%d",ans[i]);
							flag = 1;
						}
					}
					else{
						printf("%08d", ans[i]);
					}
				}
				cout << endl;
			}
		}

	}
	
	return 0;
}

C++: /*
 * Problem     : AOJ0015
 * Title       : Integral
 * Author      : mizo0203
 * Copyright   : Your copyright free
 * Description : 文字列・多倍長演算
 */

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

int N, f;
const char* str1;
const char* str2;
string str3, str4;
int sum[80];

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

bool input() {

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

  f = 0;
  cin >> str3;
  cin >> str4;
  if (str3.length() > 80 || str4.length() > 80) {
    f = 1;
    return true;
  }
  str1 = str3.c_str();
  str2 = str4.c_str();

  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 <vector>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
 
#define rep(i, n) for(int i = 0; i < n; i ++)
#define ALL(T) T.begin(), T.end()
#define mp make_pair
#define pb push_back
#define MEMSET(v, h) memset((v), h, sizeof(v))
 
using namespace std; 

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;

const int INF = 1 << 24;
 
int main(void){
    int n; cin >> n;

    while(n --){
        vi res(82);

        rep(i, 2){
            string in; cin >> in;
            rep(j, in.size() + 1){
                if(j != in.size()) res[j] += in[in.size() - j - 1] - '0';
                for(int l = 0; res[j + l] > 9; l ++) res[j + l + 1] ++, res[j + l] %= 10;
            }
        }

        if(res[80]){ cout << "overflow" << endl; continue; }

        bool ok = false;
        for(int i = 79; i >= 0; i --){
            if(!ok) if(res[i]) ok = true;
            if(ok) cout << res[i];
        }
        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;
			continue;
		}


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

	}


	return 0;
}

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

using namespace std;

string reverse(const string& str){
  string ret;
  string::const_reverse_iterator it = str.rbegin();
  for(; it != str.rend(); it++) {
    ret.push_back(*it);
  }
  return ret;
}

void cut0(string& str){
  while(str[str.size() - 1] == '0' && str.size() > 1){
    str.erase(str.size() - 1);
  }
}

int main () {
  int n;
  string a, b, sum;
  
  cin >> n;
  while(n--) {
    bool overflow = false;

    cin >> a >> b;
    if (a.size () > 80 || b.size() > 80) {
      cout << "overflow" << endl;
      continue;
    }

    a = reverse(a);
    b = reverse(b);
    a.resize(80, '0');
    b.resize(80, '0');
    sum.clear();
    sum.resize(80, '0');
    
    for(size_t i = 0; i < 80; i++) {
      sum[i] += a[i] - '0' + b[i] - '0';
      if(sum[i] > '9'){
        sum[i] -= 10;
        if(i < 79) {
          sum[i+1] = '1';
        }
        else {
          overflow = true;
          break;
        }
      }
    }
    if(overflow){
      cout << "overflow" << endl;
    }
    else {
      cut0(sum);
      cout << reverse(sum) << endl;
    }
  }
}