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<vector>
#include<string>
 
using namespace std;
 
class compute
{
private:
        vector<int> sum;
        int carry, temp;
        void Init();
public:
        void calc(string s1, string s2);
};
 
void compute::Init()
{ sum.clear(); }
 
void compute::calc(string s1, string s2)
{
        Init();
        int a = s1.size();
        int b = s2.size();
 
        if(a > 80 || b > 80){ cout << "overflow" << endl; return; }
        
        a--; b--;
        carry = 0;
        
        while(a >= 0 || b >= 0){
                temp = 0;
                if(a >= 0){ temp += (s1[a]-'0'); }
                if(b >= 0){ temp += (s2[b]-'0'); }
                sum.push_back((temp+carry)%10);
                carry = (temp+carry)/10;
                a--; b--;
        }
        if(carry){ sum.push_back(carry); }
        if(sum.size() > 80){ cout << "overflow" << endl; return; }
        for(int i = sum.size()-1; i >= 0 ; i--){
                cout << sum[i]; 
        }
        cout << endl;
}
 
int main(void)
{
 
        int n;
        string s1, s2;
        compute s;
        
        cin >> n;
        
        while(n-->0){
                cin >> s1 >> s2;
                s.calc(s1, s2);
        }
 
        return 0;
}

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

using namespace std;


int main(){

	int n;
	cin >> n;
	for(int i=0 ; i<n ; i++){
		string a, b;
		cin >> a;
		cin >> b;

		if(b.size() > a.size()){
			string temp;
			temp = a;
			a = b;
			b = temp;
		}

		if(a.size() > 80){
			cout << "overflow" << endl;
		}else{
			for(int j=0 ; j<b.size() ; j++){
				a[a.size()-1-j] = a[a.size()-1-j] + b[b.size()-1-j] -'0';
				if(a[a.size()-1-j] > '9'){
					a[a.size()-1-j] -= 10;
					for(int l=0 ; l<a.size()-1 ; l++){
						a[a.size()-2-l] ++;
						if(a[a.size()-2-l] > '9'){
							if(a.size()-2-l == 0){
								string A;
								A += '0';
								A += a;
								a = A;
							}
							a[a.size()-2-l] -= 10;
						}else break;
					}
				}
			}
		}
		cout << a << endl;

		}

	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  string s,n,final;
  int o,c=0,lim;
  cin>>lim;
  for(int j = 0 ; j < lim ; j++){
    cin>>s>>n;
      reverse(s.begin(),s.end());
    reverse(n.begin(),n.end());
    for(int i = 0; i < s.size() || i<n.size() || c;i++){
      o = (s.size() > i ? s[i]-'0' : 0) +(n.size() > i ? n[i]-'0' : 0) + c;
      
      //   o = (s[i]-'0')+(n[i]-'0')+c;
      c = o / 10;
      o %= 10;
      final.append(1,o+'0');
    }
    reverse(final.begin(),final.end());
    if(final.size()>80) cout<<"overflow"<<endl;
    else cout<<final<<endl;
    final.clear();
  }
}

C++: #include <iostream>
#include <string>
#include <cstdio>
#include <algorithm>
#include <stdexcept>

class biglong {
	static const int part_digits = 8;
	static const int max_parts = 10;
	static const int max_digits = part_digits * max_parts;
	static const unsigned long max_part_value = 100000000;
	unsigned long parts[max_parts];
public:
	biglong(unsigned long value) : parts() { parts[0] = value; }
	biglong(const biglong& rhs) {
		std::copy(rhs.parts, rhs.parts + max_parts, parts);
	}
	explicit biglong(const std::string& rhs) : parts() {
		if (rhs.size() > max_digits) {
			throw std::overflow_error("biglong overflow");
		}
		int part_count = (static_cast<int>(rhs.size()) + part_digits - 1) / part_digits;
		int pos = static_cast<int>(rhs.size());
		for (int i = 0; i < part_count; ++i) {
			pos -= part_digits;
			if (pos < 0) {
				parts[i] = std::atol(rhs.substr(0, pos + part_digits).c_str());
			} else {
				parts[i] = std::atol(rhs.substr(pos, part_digits).c_str());
			}
		}
	}
	biglong& operator+=(const biglong& rhs) {
		for (int i = 0; i < max_parts - 1; ++i) {
			parts[i] += rhs.parts[i];
			if (parts[i] >= max_part_value) {
				parts[i] -= max_part_value;
				++parts[i + 1];
			}
		}
		if (parts[max_parts - 1] >= max_part_value) {
			throw std::overflow_error("biglong overflow");
		}
		return *this;
	}
	std::string c_str() const {
		std::string result;
		for (int i = max_parts - 1; i >= 0; --i) {
			if (!result.empty() || parts[i] != 0) {
				char buff[12] = {};
				if (result.empty()) {
					sprintf(buff, "%lu", parts[i]);
				} else {
					sprintf(buff, "%0*lu", part_digits, parts[i]);
				}
				result += buff;
			}
		}
		if (result.empty()) {
			result = "0";
		}
		return result;
	}
};

biglong operator+(const biglong& lhs, const biglong& rhs)
{
	return biglong(lhs) += rhs;
}

std::ostream& operator<<(std::ostream& os, const biglong& value)
{
	return os << value.c_str();
}

int main()
{
	int count = 0;
	std::cin >> count;
	for (int i = 0; i < count; ++i) {
		std::string input1, input2;
		std::cin >> input1 >> input2;
		try {
			biglong value1(input1);
			biglong value2(input2);
			biglong sum = value1 + value2;
			std::cout << sum << std::endl;
		}
		catch (const std::overflow_error&) {
			std::cout << "overflow" << std::endl;
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);

#define CLR(a) memset((a), 0 ,sizeof(a))

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};

int main() {
  int n;
  cin >> n;

  REP(i, n) {
    char s1[100], s2[100], ans[100];
    cin >> s1 >> s2;

    int c = 0;
    int cnt = 0, j = strlen(s1)-1 , k = strlen(s2)-1;
    while(j >= 0 || k >= 0 || c) {
      char s = c;
      if(j >= 0) s += s1[j] - '0';
      if(k >= 0) s += s2[k] - '0';
      if(s > 9) {
	s -= 10;
	c = 1;
      }
      else 
	c = 0;

      s += '0';

      ans[cnt] = s;
      cnt++, j--, k--;
    }

    int len = strlen(ans);
    if(len > 80) 
      cout << "overflow" << endl;
    else {
      for(j = len - 1; j >= 0; j--) {
	cout << ans[j];
      }
      cout << endl;
    }
  }
}