Go: package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Scan()
	dataset, _ := strconv.Atoi(sc.Text())
	var firstdata *big.Int

	for i := 0; i < dataset*2; i++ {
		n := new(big.Int)
		sc.Scan()
		data, _ := n.SetString(sc.Text(), 10)

		if i%2 == 0 {
			firstdata = data
			continue
		}

		result := new(big.Int)
		if result := result.Add(data, firstdata); len(result.String()) > 80 {
			fmt.Println("overflow")
			continue
		} else {
			fmt.Println(result)
		}
	}
}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;

class LargeInteger
{
private:
	vector<int> places;
public:
	LargeInteger( string number )
	{
		reverse( number.begin(), number.end() );

		for ( unsigned int i = 0; i < number.length(); i++ )
		{
			if( i < places.size() )
			{
				this -> places[i] = number[i] - '0';
			}
			else
			{
				this -> places.push_back( number[i] - '0' );
			}
		}

		return;
	}

	LargeInteger& operator += ( string number )
	{
		reverse( number.begin(), number.end() );

		for ( unsigned int i = 0; i < number.length(); i++ )
		{
			if ( i < places.size() )
			{
				this -> places[i] += number[i] - '0';
			}
			else
			{
				this -> places.push_back( number[i] - '0' );
			}
		}

		return *this;
	}

	void printNumber()
	{
		adjust();

		if ( places.size() < 80 )
		{
			for ( vector<int>::reverse_iterator it = places.rbegin(); it != places.rend(); it++ )
			{
				cout << *it;
			}
		}
		else
		{
			cout << "overflow";
		}
		cout << endl;
		
		return;
	}
	
	void adjust()
	{
		for ( unsigned int i = 0; i < places.size(); i++ )
		{
			if ( 10 <= places[i] )
			{
				if ( i + 1 < places.size() )
				{
					places[i+1] += places[i] / 10;
				}
				else
				{
					places.push_back( places[i] / 10 );
				}
				places[i] %= 10;
			}
		}

		return;
	}
};


int main()
{
	int n;
	string buffer;

	cin >> n;

	for ( int i = 0; i < n; i++ )
	{
		cin >> buffer;
		LargeInteger li( buffer );

		cin >> buffer;
		li += ( buffer );

		li.printNumber();
	}

	return 0;
}

C++: #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main(){
	string a,b;
	vector<int> ans;
	int n,tmp,carry,num;
	bool flag = true;
	cin >> n;
	for(int i=0; i<n; i++){
		ans.clear();
		cin >> a >> b;
		int ai = a.size()-1;
		int bi = b.size()-1;
		carry=0;
		while(ai >= 0 || bi >= 0){
			tmp=0;
			if(ai >= 0) tmp += a[ai] - '0';
			if(bi >= 0) tmp += b[bi] - '0';
			ans.push_back((tmp+carry)%10);
			carry = (tmp+carry)/10;
			ai--; bi--;
		}
		if(carry != 0) ans.push_back(carry);
		if(ans.size() > 80 && flag == true){
			cout << "overflow" << endl;
			flag = false;
		}
		if(flag == true){
			for(int j=ans.size()-1; j>=0; j--)
				cout << ans[j];
			cout << endl;
		}
	}
	return 0;
}

C++: #include<vector>
#include<iostream>
#include<iomanip>
#include<string>
#include<cstdlib>

typedef std::vector<int> bignum;

const int e9=1000000000;

bignum plus(const bignum& a,const bignum& b);
bignum minus(const bignum& a,const bignum& b);
void output(const bignum& num);
int compare(const bignum& a,const bignum& b);
bignum newnum(const std::string& str);

int main()
{
	bignum a,b,sum;
	std::string str;
	int n;
	std::cin>>n;
	for(int i=0;i<n;i++)
	{
		std::cin>>str;
		a=newnum(str);
		std::cin>>str;
		b=newnum(str);
		sum.clear();
		sum=plus(a,b);
		if(compare(sum,newnum("10000000000000000000000000000000000000000000000000000000000000000000000000000000"))>0)
		{
			std::cout<<"overflow"<<std::endl;
		}
		else
		{
			output(sum);
		}
	}
}

bignum plus(const bignum& a,const bignum& b)
{
	bignum sum;
	int carry=0;
	long long temp;
	for(int i=0;i<((a.size()>b.size())?a.size():b.size())||carry==1;i++)
	{
		temp=carry;
		carry=0;
		if(i<a.size())
		{
			temp+=a[i];
		}
		if(i<b.size())
		{
			temp+=b[i];
		}
		sum.push_back(temp%e9);
		if(temp>=e9)
		{
			carry=1;
		}
	}

	return sum;
}

int compare(const bignum& a,const bignum& b)
{
	if(a.size()>b.size()){return 1;}
	else if(a.size()<b.size()){return -1;}
	else
	{
		for(int i=a.size()-1;i>=0;i--)
		{
			if(a[i]>b[i]){return 1;}
			else if(a[i]<b[i]){return -1;}
		}
	}
	return 0;
}

bignum newnum(const std::string& str)
{
	bignum num;
	int len;
	for(int i=str.size();i>=0;i-=9)
	{
		len=9;
		if(i<9)len=i;
		num.push_back(atoi(str.substr(i-len,len).c_str()));
	}
	return num;
}

void output(const bignum& num)
{
	for(int i=num.size()-1;i>=0;i--)
	{
		if(i==num.size()-1)
		{
			std::cout<<num[i];
		}
		else
		{
			std::cout<<std::setfill('0')<<std::setw(9)<<std::right<<num[i];
		}
	}
	std::cout<<std::endl;
}

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

void Calc( string &str, int sum, int trans, int &move_up )
{
    if( sum > 9 )
    {
        str += sum - 10 + trans;                       // Integer to String
        move_up = 1;
    }
    else
    {
        str += sum + trans;                            // Integer to String
        move_up = 0;
    }
}

int main()
{
    int n, trans = 48;                                 //48は文字としての0を整数に変換したときの値。ex) '6' - 48 = 6
    int move_up = 0;
    string str1, str2, strr = "";

    cin >> n;

    for( int i = 0; i < n; i++ )
    {
        cin >> str1 >> str2;

        int s1 = str1.size(), s2 = str2.size();                     // while分を回す回数を決定
        int j = s1 - 1, k = s2 - 1, sum = 0;                        // sumは位ごとの合計値
        while( j >= 0 && k >= 0 )                                   // 最後の桁まで繰り上がり等計算
        {
            sum = str1[j] + str2[k] - 2 * trans + move_up;          // String to Integer
            Calc( strr, sum, trans, move_up );                      // 繰り上がりの計算
            j--;
            k--;
        }
        while( j >= 0 )                                             // 余った桁を順次格納(繰り上がり情報は保持)
        {
            sum = str1[j] - trans + move_up;
            Calc( strr, sum, trans, move_up );
            j--;
        }
        while( k >= 0 )
        {
            sum = str2[k] - trans + move_up;
            Calc( strr, sum, trans, move_up );
            k--;
        }
        if( move_up == 1 )                                          // 最後の桁での繰り上がり処理
            strr += 1 + trans;

        int sr = strr.size();
        if( sr <= 80 )
        {
            for( int i = sr - 1; i >= 0; i-- )                      // 100という文字列strは、str[0] = 1, str[1] = 0, str[2] = 0という順番で格納される。　
                cout << strr[i];
            cout << endl;
        }
        else
            cout << "overflow" << endl;

        strr = "";                                                  // strrの値をクリア
        move_up = 0;
    }
    return 0;
}

C++: #include <algorithm>
#include <cctype>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <functional>
#include <string>
#include <queue>
#include <vector>

using namespace std;

int main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    int a[128], b[128], r[128];
    fill(a, a+128, 0);
    fill(b, b+128, 0);
    fill(r, r+128, 0);
    string sa, sb;
    cin >> sa >> sb;
    reverse(sa.begin(), sa.end());
    reverse(sb.begin(), sb.end());
    for (unsigned int j = 0; j < min(128, int(sa.length())); j++)
      a[j] = sa[j] - '0';
    for (unsigned int j = 0; j < min(128, int(sb.length())); j++)
      b[j] = sb[j] - '0';
    for (int j = 0; j <= 80; j++) {
      r[j] += a[j] + b[j];
      r[j+1] += r[j] / 10;
      r[j] %= 10;
    }
    if (r[80])
      cout << "overflow" << endl;
    else {
      int k = 79;
      for (; k >= 1 && !r[k]; k--);
      for (int j = k; j >= 0; j--)
        cout << r[j];
      cout << endl;
    }
  }
  return 0;
}