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

C++: #include <iostream>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::multiprecision;

int main() {
	int n;
	cpp_int a, b, sum;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a >> b;
		sum = a + b;
		string str = sum.str();
		if (str.length() > 80) cout << "overflow" << endl;
		else cout << a + b << endl;
	}
	return 0;
}

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

using namespace std;

void arrangeDigits(string str1, string str2){
  // st1 > str2
  if(str1.length() <= str2.length()){
    string tmp = str1;
    str1 = str2;
    str2 = tmp;
  }

  string tmp2;
  for(int i=0;i<str1.length()-str2.length();i++){
    tmp2 += '0';
  }
  tmp2 += str2;
  str2 = tmp2;
  // cout << "str1: " << str1 << endl;
  // cout << "str2: " << str2 << endl;
}

int main(){
  int numDatasets;
  cin >> numDatasets;
  
  for(int i=0;i<numDatasets;i++){
    bool flag = false;
    string str1, str2;

    cin >> str1;
    //80????¶?????????´???
    if(str1.length() > 80){
      flag = true;
    }

    cin >> str2;
    //80????¶?????????´???
    if(str2.length() > 80){
      flag = true;
    }

    // ??????????????????
    arrangeDigits(str1, str2);
      
    //?¨????

    int c = 0;
    string res;
    for(int i=0;i<str1.length();i++){
      int now;
      if((int)((char)str2[str2.size()-i-1]-'0') == -48){
	now = (int)(str1[str1.size()-i-1]-'0') + c;
      }
      else{
	now = (int)(str1[str1.size()-i-1]-'0') + (int)((char)str2[str2.size()-i-1]-'0') + c;
      }
      
      res = (char)(now%10 + '0') + res;
      c = now/10;
      // str1.pop_back();
      // str2.pop_back();
      // cout << "----" << endl;
      // cout << "i:" << i << endl;
      // cout << (int)(str1[str1.size()-i-1]-'0') << " + " << (int)(str2[str2.size()-i-1]-'0') << endl;
      // cout << "now:" << now << endl;
      // cout << "res:" << res << endl;
    }

    if(c>0){
      res = (char)(c-'0') + res;
    }
    
    if(flag == false){
      
      cout << res << endl;
    }else{
      cout << "overflow" << endl;
    }
    
  }
}