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 <cstdio>
#include <cstring>
#define N 256
using namespace std;

void pr( vector<int> a ){
  int i=0;
  while( a[i]==0 ) i++;

  for( ;i<a.size();i++ )
    cout << a[i];
  cout << endl;
}

int main(){
  char s[100], c;
  vector<int> a,b;
  int n, an,bn, len;
  cin >> n;
  fgets( s,N,stdin );
  for( int loop=0;loop<n;loop++ ){
    a.clear();
    fgets( s,N,stdin );
    
    for( int i=0; s[i]!='\n' ;i++ )
      a.push_back( s[i]-'0' );
    b.clear();
    fgets( s,N,stdin );
    for( int i=0;s[i]!='\n';i++ )
      b.push_back( s[i]-'0' );
    an=a.size(); bn=b.size();
    while( an>bn ){
      b.insert( b.begin(),1, 0 ); bn++;
    }
    while( an<bn ){
      a.insert( a.begin(),1, 0 ); an++;
    }

    //    pr(a);
    //    pr(b);
    a.insert( a.begin(),1,0 );
    b.insert( b.begin(),1,0 );
    for( int i=an;i>=0;i-- ){
      a[i]+=b[i];
      if( a[i]>=10 ){
	a[i]-=10; a[i-1]++;
      }
    }
    pr( a );
  }

  return 0;
}

C++: #include <iostream>
#include <sstream>
#include <cmath>
using namespace std;

int main()
{
	int n;
	cin >> n;
	for(int i=0;i<n;i++){
		int p1[100],p2[100];
		for(int i=0;i<100;i++){
			p1[i] = 0; p2[i] = 0;
		}
		string a,b;
		cin >> a ;
		cin >> b ;
		if(a.size() > 80 || b.size() > 80){
			cout << "overflow" << endl;
			continue;
		}

		int pos = 0;
		for(unsigned i=a.size();i>0;i--){
			stringstream sst;
			sst << a[i-1];
			sst >> p1[pos++];
		}
		pos = 0;
		for(unsigned i=b.size();i>0;i--){
			stringstream sst;
			sst << b[i-1];
			sst >> p2[pos++];
		}
		for(int i=0;i<100;i++){
			int ans = p1[i]+p2[i];
			p1[i] = ans % 10;
			p1[i+1] += ans/10;
		}
		if(p1[80] != 0){
			cout << "overflow" << endl;
			continue;
		}
		
		bool flag = true;
		for(int i=79;i>=0;i--){
			if(flag){
				if(p1[i] == 0)
					continue;
				else
					flag = false;
			}
			cout << p1[i];
		}
		cout << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;

string reserve(string a, int len)
{
    string rev = a;
    for (int i=0;i<len;i++)
    {
        rev[i] = a[len-i-1];
    }
    return rev;
}

int main()
{
    string a,b,d;
    int num;
    int cons;
    d = "";
    int tmp;
    cin >> num;
    while(num--)
    {
        cin >> a >> b;
        a = reserve(a,a.size());

        b = reserve(b,b.size());
        int maxi = max(a.size(),b.size());
        int mini = min(a.size(),b.size());
        d.resize(maxi+1);
        a.resize(maxi+1,0);
        b.resize(maxi+1,0);
        int c[maxi+1];
        int i;
        for(i=0;i<=maxi;i++)
        {
            c[i] = 0;
        }


                for(int i=0 ;i <=maxi;i++)
                {
                    if(i<mini)
                        cons = 96;
                    else  if(i<maxi)
                        cons = 48;
                    else cons = 0;
                    tmp = a[i] + b[i] + c[i] - cons;
                    if (tmp > 9)
                    {
                        c[i+1] = 1;
                        tmp -= 10;

                    }
                    d[i] = tmp + 48 ;
                }


        if(c[maxi]==1)
            d.resize(maxi+1);
        else d.resize(maxi);

        if(d.size() > 80 || a.size() >80 || b.size()>80)
            cout << "overflow" << endl;
        else
        {
            d = reserve(d,d.size());
            cout << d << endl;
        }

    }
    return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>

using namespace std;
typedef long long ll;

#define PI 3.141592653

int main(){
    string A,B;
    int n,Ak,Bk,ans[81];
    
    scanf("%d",&n);
    
    for(int i=0;i<n;i++){
        
        for(int j=0;j<80;j++){
            ans[j]=0;
        }
        
        cin >> A >> B;
        
        if(A==B && A=="0"){
            printf("0\n");
            continue;
        }
        
        Ak=(int)A.size();
        Bk=(int)B.size();
        
        for(int j=0;j<max(Ak,Bk);j++){
            if(j<min(Ak,Bk))
                ans[79-j]+=(A[Ak-1-j]-'0')+(B[Bk-1-j]-'0');
            else if(j<Ak)
                ans[79-j]+=A[Ak-1-j]-'0';
            else if(j<Bk)
                ans[79-j]+=B[Bk-1-j]-'0';
            
            if(ans[79-j]>=10){
                if(j==79){
                    break;
                }
                ans[79-j-1]++;
                ans[79-j]-=10;
            }
        }
        
        if(ans[79]>=10){
            puts("overflow");
        }else{
            bool f = false;
            for(int j=0;j<80;j++){
                if(ans[j]>0 || f){
                    printf("%1d",ans[j]);
                    f = true;
                }
            }
            printf("\n");
        }
    }
    
    return 0;
}

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

#define times(n, i) uptil(0, n, i)
#define upto(f, t, i) for(auto _##i = (t), i = decltype(_##i)(f) poi  i <= _##i poi  i++)
#define uptil(f, t, i) for(auto _##i = (t), i = decltype(_##i)(f) poi  i < _##i poi  i++)
#define downto(f, t, i) for(auto i = (f), _##i = decltype(i)(t) poi  i >= _##i poi  i--)
#define downtil(f, t, i) for(auto i = (f), _##i = decltype(i)(t) poi  i > _##i poi  i--)

#define unless(c) if(!(c))
#define until(c) while(!(c))
#define loop while(true)

#define poi ;
#define poipoi << "\n"

#define fuwafuwa(n, c) dokidoki((n) + (c) - 1, c)
#define dokidoki(n, c) ((n) / (c) * (c))

template<class T> bool read(T& t){
    return cin >> t poi
}
template<class T, class...U> bool read(T& t, U&... u){
    unless(cin >> t) return false poi
    return read(u...) poi
}

const int PYON = 80 poi

int main(){
    int N poi
    cin >> N poi
    times(N, i){
        string A, B poi
        cin >> A >> B poi
        if(A.size() > PYON || B.size() > PYON){
            cout << "overflow" poipoi poi continue poi
        }else if(A == "0" && B == "0"){
            cout << "0" poipoi poi continue poi
        }
        vector<int> a(PYON, 0), b(PYON, 0) poi
        upto(1, A.size(), i) a[PYON - i] = A[A.size() - i] - '0' poi
        upto(1, B.size(), i) b[PYON - i] = B[B.size() - i] - '0' poi
        int pyon = 0 poi
        vector<int> sum(PYON) poi
        downto(PYON - 1, 0, i){
            sum[i] = a[i] + b[i] + pyon poi
            pyon = sum[i] / 10 poi
            sum[i] %= 10 poi
        }
        if(pyon) cout << "overflow" poi
        else times(PYON, i) if((pyon = pyon || sum[i])) cout << sum[i] poi
        cout poipoi poi
    }
    return 0 poi
}