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>
using namespace std;
bool checkOverFlow(string& p) {
  //80行超えているかを判定
  if(p.size() > 80) {
    return false;
  } else return true;
}

void addZero(string& p, int num) {
  //addZero(string型, 0を先頭に付け加える個数)
  for(int i=0; i<num; i++) {
    p = '0' + p;
  }
  return;
}

int main() {
  int N;//データセットの個数
  cin >> N;
  //データを配列にセット
  string* value1 = new string[N];
  string* value2 = new string[N];
  for(int i=0; i<N; i++) {
    cin >> value1[i] >> value2[i];
    //80行超えていたらoverflow
    if(value1[i].size() > 80 or value2[i].size() > 80) {
      value1[i] = "overflow";
    } else {
      //桁数を先頭に0をつけて揃える
      if(value1[i].size() > value2[i].size()) {
        addZero(value2[i], value1[i].size() - value2[i].size());
      } else {
        addZero(value1[i], value2[i].size() - value1[i].size());
      }
    }
  }
  
  ////////////////
  //足し算をする//
  ////////////////
  for(int i=0; i<N; i++) {
    if(value1[i] == "overflow") {
      cout << "overflow" << endl;
      continue;
    }
    //最大の桁数
    int length = max(value1[i].size(), value2[i].size());
    //繰り上がりの保存配列
    int* carryUp = new int[length +1];
    for(int i=0; i<length +1; i++) {
      carryUp[i] = 0;
    } 
    //答えの保存配列
    int* ans = new int[length +1];
   
    for(int j=0; j<length; j++) {
      int sum;
      sum = (value1[i][value1[i].size()-j-1] - '0')
        + (value2[i][value2[i].size()-j-1] - '0')
        + carryUp[j];
      if(sum>9) carryUp[j+1] = 1;
      ans[j] = sum % 10;

      /*
        cout << "value1:  " << value1[i][value1[i].size()-j-1] - '0' << endl;
        cout << "value2:  " << value2[i][value2[i].size()-j-1] - '0' << endl;
        cout << "carryUp: " << carryUp[j] << endl;
        cout << "ans      " << ans[j] << endl;
        cout << "===========" << endl;
      */
    }

    //出力
    int start;//桁数(1:length桁 0:length+1桁)
    if(carryUp[length] == 1){
      ans[length] = 1;
      start = 0;
    } else start = 1;

    string output = "";
    for(int i=start; i<=length; i++) {
      output += ans[length -i];
    }

    if(output.size() > 80) {
      cout << "overflow" << endl;
    } else {
      for(int i=start; i<=length; i++) {
        cout << ans[length -i];
      }
      cout << endl;
    }
    
    delete[] carryUp;
    delete[] ans;
  }
  delete[] value1;
  delete[] value2;
}

C++: #define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

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


int main(){
  int n;
  cin>>n;
  
  string a,b;

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

C++: #include<iostream>
#include<algorithm>
#include<sstream>
#include<string>
using namespace std;
int main(){
	int n;
	for(cin>>n;n--;){
		string a,b;
		cin>>a;
		cin>>b;
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());
		while(a.size()<b.size())a+='0';
		while(b.size()<a.size())b+='0';
		int f=0;
		for(int i=0;i<a.size();i++){
			if((a[i]-'0')+(b[i]-'0')+f>9){
				a[i]=a[i]+(b[i]-'0')+f-10;
				f=1;
			}else{
				a[i]=a[i]+(b[i]-'0');
				f=0;
			}
		}
		reverse(a.begin(),a.end());
		if(f)a="1"+a;
		if(a.size()>80){
			cout<<"overflow"<<endl;
		}else{
			for(int i=0;i<a.size();i++){
				if(a[i]!=0)
				cout<<a[i];
			}
			cout<<endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <deque>
class BigInt
{
  std::deque<char> m_digits;
public:
  BigInt(std::string str) {
    for(auto it = str.begin(); it != str.end(); ++it) {
      m_digits.push_back(*it - '0');
    }
  }

  BigInt(int num) {
    std::ostringstream oss;
    oss << num;
    BigInt(oss.str());
  }

  std::string str() const {
    std::string str;
    for (auto it = m_digits.begin(); it != m_digits.end(); ++it) {
      str += *it + '0';
    }
    return str;
  }

  const BigInt& operator +=(const BigInt& rhs) {
    std::deque<char> new_digits;
    auto lhs_rit = m_digits.rbegin();
    auto rhs_rit = rhs.m_digits.rbegin();

    char inc = 0;
    while (lhs_rit != m_digits.rend() &&
           rhs_rit != rhs.m_digits.rend()) {
      char temp = *lhs_rit + *rhs_rit;
      temp += inc;
      if (temp >= 10) {
        inc = temp / 10;
        temp -= inc * 10;
      }
      new_digits.push_front(temp);
      ++lhs_rit;
      ++rhs_rit;
    }

    if (lhs_rit != m_digits.rend()) {
      while (lhs_rit != m_digits.rend()) {
        char temp = *lhs_rit + inc;
        if (temp >= 10) {
          inc = temp / 10;
          temp -= inc * 10;
        }
        new_digits.push_front(temp);
        ++lhs_rit;
      }
    }
    else if (rhs_rit != rhs.m_digits.rend()) {
      while (rhs_rit != rhs.m_digits.rend()) {
        char temp = *rhs_rit + inc;
        if (temp >= 10) {
          inc = temp / 10;
          temp -= inc * 10;
        }
        new_digits.push_front(temp);
        ++rhs_rit;
      }
    }
    if (inc > 0) new_digits.push_front(inc);
    m_digits = new_digits;
  }
};

BigInt operator +(const BigInt& lhs, const BigInt& rhs)
{
  BigInt result(lhs);
  result += rhs;
  return result;
}

int main()
{
  int n;
  std::cin >> n;
  while (n--) {
    std::string num;
    std::cin >> num;
    BigInt num1(num);
    std::cin >> num;
    BigInt num2(num);
    
    BigInt num3 = num1 + num2;
    std::cout << num3.str() << std::endl;
  }
  return 0;
}