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<cstdio>
#include<stack>
#include<algorithm>
using namespace std;
string str1;
string str2;
stack<int> sta;

int main()
{
  int n;
  int i,j;
  int exc;//??°?????????
  int sum;

  cin>>n;
  for(i=0;i<n;i++){
    cin>>str1;
    cin>>str2;
    if(str1.size()>80 || str2.size()>80){
      cout<<"overflow"<<endl;
      return 0;
    }
    exc=0;
    for(j=1;j<=min(str1.size(),str2.size());j++){
      sum=str1[str1.size()-j]-'0'+str2[str2.size()-j]-'0'+exc;
      exc=sum/10;
      sta.push(sum%10);
    }
    if( str1.size() < str2.size() ){
      while(j<=str2.size()){
	sum=str2[str2.size()-j]-'0'+exc;
	exc=sum/10;
	sta.push(sum%10);
	j++;
      }
    }else if( str1.size() > str2.size() ){
      while(j<=str1.size()){
	sum=str1[str1.size()-j]-'0'+exc;
	exc=sum/10;
	sta.push(sum%10);
	j++;
      }
    }
    if(max(str1.size(),str2.size())==80 && exc==1){
      cout<<"overflow"<<endl;
      return 0;
    }
    if(exc)
      cout<<exc;
    for(j=0;j<max(str1.size(),str2.size());j++){  
      cout<<sta.top();
      sta.pop();
    }
    cout<<endl;
  }
}

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

using namespace std;

int main() {
    int N;
    cin >> N;
    while(N--) {
        string s1, s2;
        cin >> s1 >> s2;

        if(s1.size() > 80 || s2.size() > 80) {
            cout << "overflow" << endl;
            continue;
        }
        char buf[81] = {0};
        int p1 = s1.size()-1, p2 = s2.size()-1, pb = 79;
        int carry = 0;
        while(p2 >= 0) buf[pb--] = s2[p2--];
        pb = 79;
        while(pb >= 0 && (p1 >= 0 || carry > 0)) {
            int bd = buf[pb];
            if(bd > 0) bd -= '0';
            int bp = 0;
            if(p1 >= 0) bp = s1[p1--]-'0';
            int d = bp + bd + carry;
            carry = d / 10;
            d %= 10;
            buf[pb--] = d+'0';
        }
        while(buf[pb]) pb--;
        if(pb == -1 && carry > 0) cout << "overflow" << endl;
        else cout << (char*)(buf+(pb+1)) << endl;
    }
    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 i=0 ; i<b.size() ; i++){
				a[a.size()-1-i] += b[b.size()-1-i] - '0';
				if(a[a.size()-1-i] > '9'){
					a[a.size()-1-i] -= 10;
					for(int j=i ; a.size()-2-j >= 0 ; j++){
						a[a.size()-2-j]++;
						if(a[a.size()-2-j] > '9'){
							a[a.size()-2-j] -= 10;
							if((a.size()-2-j) == 0){
								a = "1" + a;
								break;
							}
						}else break;
					}
				}
			}
		}
		if(a.size() > 80){
			cout << "overflow" << endl;
		}else{
			cout << a << endl;
		}
		

	}

	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>
#include<iomanip>

#define EPS (1e-10)
using namespace std;
#define PI (3.1415926535)

int main(){
	string a, b;
	vector<int> m, n, s;
	int set;

	m.resize(81, 0);
	n.resize(81, 0);
	s.resize(81, 0);

	cin >> set;
	while(set-- > 0){
		a.clear();
		b.clear();
		cin >> a >> b;
		for(int i = 0; i < 81; i++){
			m[i] = n[i] = s[i] = 0;
		}		
		if(a.size() > 80 || a.size() > 80){
			cout << "overflow" << endl;
		}else{
			reverse(a.begin(), a.end());
			reverse(b.begin(), b.end());
			for(int i = 0; i < a.size(); i++){
				m[i] = a[i] - '0';
			}
			for(int i = 0; i < b.size(); i++){
				n[i] = b[i] - '0';
			}
			for(int i = 0; i < 80; i++){
				s[i] += m[i] + n[i];
				if(s[i] >= 10){
					s[i+1]++;
					s[i]-=10;
				}
			}
			int digit = 81;
			while(--digit > 0){
				if(s[digit] != 0)break;
			}
			if(digit >= 79){
				cout << "overflow" << endl;
			}else{
				for(int i = digit; i >= 0; i--){
					cout << s[i];
				}
				cout << endl;
			}
		}
	}

	return 0;
}

C++: #include <stdio.h>
#include <string.h>
int main(void){
    int n,ap,bp,cp,t;
    char a[81],b[81],c[81];
    scanf("%d",&n);
    while(~scanf("%s%s",&a,&b)){
        ap=strlen(a);
        bp=strlen(b);
        cp=sizeof(c);
        c[cp]='\0';
        t=0;
        while((t||ap||bp)&&cp>0){
            t+=(ap?a[--ap]-'0':0)+(bp?b[--bp]-'0':0);
            c[--cp]='0'+(t%10);
            t/=10;
        }
        if(t)printf("overflow\n");
        else printf("%s\n",&c[cp]);
    }
    return 0;
}

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

#define DIGIT  ( 80 )

using namespace std;

static
int N;

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  cin >> N;

  while ( N-- )
  {
    string  A, B;
    int     C[ DIGIT + 1 ] = { 0 };

    cin >> A >> B;

    for ( size_t i = 0; i < A.length ( ); ++i )
    {
      C[ i ]      = A[ A.length ( ) - i - 1 ] - '0';
    }
    for ( size_t i = 0; i < B.length ( ); ++i )
    {
      C[ i ]     += B[ B.length ( ) - i - 1 ] - '0';
    }
    for ( size_t i = 0; i < DIGIT; ++i )
    {
      C[ i + 1 ] += C[ i ] / 10;
      C[ i ]     %= 10;
    }

    if ( C[ DIGIT ] )
    {
      cout << "overflow";
    }
    else
    {
      int i = DIGIT;
      while ( !C[ i ] && i > 0 )  --i;
      while ( i >= 0 )
      {
        cout << C[ i-- ];
      }
    }
    cout << endl;
  }

  return ( 0 );
}

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

int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i)
	{
		int A[150] = {},B[150] = {},C[150] = {};
		string inA,inB;
		cin >> inA >> inB;
		for (int j = 0; j < inA.size(); ++j)
			A[inA.size()-j] = (int)(inA[j]-'0');
		for (int j = 0; j < inB.size(); ++j)
			B[inB.size()-j] = (int)(inB[j]-'0');
		int keta = 0;
		for (int j = 1; j < 150; ++j)
		{
			C[j] += A[j] + B[j];
			if(C[j] >= 10)
			{
				C[j+1] += C[j]/10;
				C[j] = C[j]%10;
			}
			if(C[j] != 0)
				keta = j;
		}
		if(keta >= 80)
			cout << "overflow" << endl;
		else
		{
			bool haji = 0;
			for (int j = 149; j > 0; --j)
			{
				if(C[j] != 0)
					haji = 1;
				if(haji)
				{
					cout << C[j];
				}
			}
			cout << endl;
		}
	}
}