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<cstdlib>
#define DIGIT 80
using namespace std;

class largenum{
  int nums[DIGIT];
  bool overflow;
  int most;
public:
  largenum(){
    overflow=false;
    most=DIGIT-1;
    for(int i=0;i<DIGIT;i++)
      nums[i]=0;
  }
  bool isoverflow(){ return overflow;}
  friend ostream& operator<<(ostream &out,largenum &l);
  friend istream& operator>>(istream &is,largenum &l);
  friend largenum operator+(largenum l1,largenum l2);
};

largenum operator+(largenum l1,largenum l2){
  bool carry=false;
  largenum ans;
  for(int i=DIGIT-1;i>=0;i--){
    int tmp=l1.nums[i]+l2.nums[i]+carry;
    carry=bool((tmp)/10);
    ans.nums[i]=(tmp)%10;
  }
  for(int i=0;i<DIGIT;i++){
    if(ans.nums[i]!=0){
      ans.most=i;
      break;
    }
  }  
  ans.overflow=carry;
  return ans;
}

ostream& operator<<(ostream &out,largenum &l){
  for(int i=l.most;i<DIGIT;i++){
    out<<l.nums[i];
  }
  return out;
}

istream& operator>>(istream &is,largenum &l){
  string str;
  is>>str;
  if(str.size()>DIGIT){
    l.overflow=true;
  }else{
    for(int i=0;i<(int)str.size();i++){
      int index = DIGIT-str.size()+i;
      switch(str[i]){
      case '0':
	l.nums[index]=0;
	break;
      case '1':
	l.nums[index]=1;
	break;
      case '2':
	l.nums[index]=2;
	break;
      case '3':
	l.nums[index]=3;
	break;
      case '4':
	l.nums[index]=4;
	break;
      case '5':
	l.nums[index]=5;
	break;
      case '6':
	l.nums[index]=6;
	break;
      case '7':
	l.nums[index]=7;
	break;
      case '8':
	l.nums[index]=8;
	break;
      case '9':
	l.nums[index]=9;
	break;
      }
    }
    
    l.most=DIGIT-str.size();
  }
  return is;
}

int main(){
  int num;
  cin>>num;
  while(num--){
    largenum a,b;
    cin>>a>>b;
    if(a.isoverflow() || b.isoverflow()){
      cout<<"overflow"<<endl;
      continue;
    }
    a = a+b;
    if(a.isoverflow()){
      cout<<"overflow"<<endl;
    }else{
      cout<<a<<endl;
    }
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
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;
}

void print_number( VI& number )
{
	for ( VI::iterator it = number.begin(); it != number.end(); it++ ) cout << *it;
	cout << endl;
}

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

		cout << c.size() << endl;
		if ( c.size() > 80 ) cout << "overflow" << endl;
		else print_number( c );

	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
#define mem(a) memset(a,0,sizeof(a))
#define pd(a) printf("%.10f\n",a)
#define pb(a) push_back(a)
#define in(a) insert(a)
#define pi M_PI
#define R cin>>
#define F first
#define S second
#define C class
#define ll long long
#define ln cout<<'\n'
#define _(_1,_2,_3,N,...)N
#define pr(...) _(__VA_ARGS__,pr3,pr2,pr1)(__VA_ARGS__)
template<C T>void pr1(T a){cout<<a;ln;}
template<C T,C T2>void pr2(T a,T2 b){cout<<a<<' '<<b;ln;}
template<C T,C T2,C T3>void pr3(T a,T2 b,T3 c){cout<<a<<' '<<b<<' '<<c;ln;}
template<C T>void PR(T a,int n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
bool check(int n,int m,int x,int y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1000000007,MAXL=1LL<<60,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;

string S(ll n) {
  stringstream ss;string s;
  ss << n;ss >> s;
  return s;
}
ll N(string s) {
  stringstream ss;ll n;
  ss << s;ss >> n;
  return n;
}
string CZ(string s) {
  int i;
  for(i=0; i<s.size()-1; i++)if(s[i]!='0')break;
  return s.substr(i);
}
string ADD(string s, string t) {
  if(s.size()<t.size()) swap(s,t);
  s='0'+s;
  while(s.size()>t.size()) t='0'+t;
  int c=0;
  rrep(i,s.size()) {
    if(c) {
      if(s[i]=='9') {
        s[i]='0';
        c=1;
      } else {
        s[i]=(char)(s[i]+1);
        c=0;
      }
    }
    int sum=(int)s[i]+(int)t[i]-'0'*2;
    if(sum>=10) {
      s[i]=(char)(sum-10+'0');
      c=1;
    } else s[i]=(char)(sum+'0');
  }
  return CZ(s);
}
void Main() {
  int n;
  R n;
  while(n--) {
    string s,t;
    cin >> s >> t;
    s=ADD(s,t);
    if(s.size()>80) pr("overflow");
    else pr(s);
  }
}

int main() {
  ios::sync_with_stdio(0);cin.tie(0);
  Main();return 0;
}

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

using namespace std;

int main(){
  int c,d;
  cin >>c;
  int n[81];
  string a,b;
  for(;c>0;c--){
    for(int i=0;i<81;i++) n[i] = 0;
    cin >>a>>b;
    for(int i=0;i<min((int)a.size(),80);i++)n[i] = (int)(a[a.size()-i-1]-'0');
    for(int i=0;i<min((int)b.size(),80);i++)n[i] += (int)(b[b.size()-i-1]-'0');
    for(int i=0;i<80;i++){
      if(n[i]>=10){
	n[i+1]+=n[i]/10;
	n[i]%=10;
      }
    }
    if (n[80]>0||a.size()>80||b.size()>80)
      cout << "overflow" << endl;
    else{
      d = 80;
      while(!n[d])d--;
      if (d<0)d=0;
      for(;d>=0;d--)
	cout << n[d];
      cout << endl;
      }
  }
  return 0;
}