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 <algorithm>
#include <stdexcept>

class biglong {
	static const int part_digits = 8;
	static const int max_parts = 10;
	static const int max_digits = part_digits * max_parts;
	static const unsigned long max_part_value = 100000000;
	unsigned long parts[max_parts];
public:
	biglong(unsigned long value) : parts() { parts[0] = value; }
	biglong(const biglong& rhs) {
		std::copy(rhs.parts, rhs.parts + max_parts, parts);
	}
	explicit biglong(const std::string& rhs) : parts() {
		if (rhs.size() > max_digits) {
			throw std::overflow_error("biglong overflow");
		}
		int part_count = (static_cast<int>(rhs.size()) + part_digits - 1) / part_digits;
		int pos = static_cast<int>(rhs.size());
		for (int i = 0; i < part_count; ++i) {
			pos -= part_digits;
			if (pos < 0) {
				parts[i] = std::atol(rhs.substr(0, pos + part_digits).c_str());
			} else {
				parts[i] = std::atol(rhs.substr(pos, part_digits).c_str());
			}
		}
	}
	biglong& operator+=(const biglong& rhs) {
		for (int i = 0; i < max_parts - 1; ++i) {
			parts[i] += rhs.parts[i];
			if (parts[i] >= max_part_value) {
				parts[i] -= max_part_value;
				++parts[i + 1];
			}
		}
		parts[max_parts - 1] += rhs.parts[max_parts - 1];
		if (parts[max_parts - 1] >= max_part_value) {
			throw std::overflow_error("biglong overflow");
		}
		return *this;
	}
	std::string c_str() const {
		std::string result;
		for (int i = max_parts - 1; i >= 0; --i) {
			if (!result.empty() || parts[i] != 0) {
				char buff[12] = {};
				if (result.empty()) {
					sprintf(buff, "%lu", parts[i]);
				} else {
					sprintf(buff, "%0*lu", part_digits, parts[i]);
				}
				result += buff;
			}
		}
		if (result.empty()) {
			result = "0";
		}
		return result;
	}
};

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

std::ostream& operator<<(std::ostream& os, const biglong& value)
{
	return os << value.c_str();
}

int main()
{
	int count = 0;
	std::cin >> count;
	for (int i = 0; i < count; ++i) {
		std::string input1, input2;
		std::cin >> input1 >> input2;
		try {
			biglong value1(input1);
			biglong value2(input2);
			biglong sum = value1 + value2;
			std::cout << sum << std::endl;
		}
		catch (const std::overflow_error&) {
			std::cout << "overflow" << std::endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<string, ll> PS;
typedef vector<ll> V;

int k = 0, n;
string s, t;
vector<string> ans;

int main(){
	cin >> n;
	REP(j,n){
		cin >> s >> t;
		k = 0;
		if (s.size() >= 80 || t.size() >= 80)cout << "overflow" << endl;
		reverse(ALL(s));
		reverse(ALL(t));
		int a = max(s.size(), t.size()), b = min(s.size(), t.size());
		if (s.size() > t.size()){
			REP(i, a - b){
				t += "0";
			}
		}
		else{
			REP(i, a - b){
				s += "0";
			}
		}		
		reverse(ALL(s));
		reverse(ALL(t));
		REP(i, s.size()){
			int x = (s[s.size()-1-i] - '0') + (t[s.size()-1-i] - '0');
			string q;
			stringstream ss;
			if (i != s.size() - 1){
				ss << ((x + k) % 10);
			}
			else{
				ss << x + k;
			}
			ss >> q;
			ans.push_back(q);
			if (x + k >= 10){
				k = (x + k) / 10;
			}
			else{
				k = 0;
			}
		}
		if (ans.size() >= 79)cout << "overflow" << endl;
		//cout << ans.size() << endl;
		reverse(ALL(ans));
		REP(i, ans.size()){
			cout << ans[i];
		}
		cout << endl;
		ans.clear();
	}
}

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


using namespace std;

//?????????10?????????????????????
vector<string> splitstring(string str, int n){
  vector<string> tmp;
  for(int i=0;i<str.length();i+=n){
    //    cout << "str.substr: " << str.substr(i, n) << endl;
    tmp.push_back(str.substr(i, n));
  }

  return tmp;
}


int main(){
  int numDatasets;
  cin >> numDatasets;

  for(int i=0;i<numDatasets;i++){
    vector<string> splittedStr1, splittedStr2;
    vector<int> splittedInt1, splittedInt2;
    string str1, str2;
    cin >> str1;
    
    splittedStr1 = splitstring(str1, 7);
    for(int i=0;i<splittedStr1.size();i++){
      splittedInt1.push_back(std::stoi(splittedStr1[i]));
      // cout << splittedInt1[i] << endl;
    }

    cin >> str2;

    splittedStr2 = splitstring(str2, 7);
    for(int i=0;i<splittedStr2.size();i++){
      splittedInt2.push_back(std::stoi(splittedStr2[i]));
      // cout << splittedInt2[i] << endl;
    }

    vector<int> calced(max(splittedInt1.size(), splittedInt2.size()), 0);
    
    for(int i=0;i<calced.size();i++){
      if(i < splittedInt1.size()){
	calced[i] += splittedInt1[i];
      }
      if(i < splittedInt2.size()){
	calced[i] += splittedInt2[i];
      }
    }

    //debug
    for(int i=0;i<calced.size();i++){
      // cout << i << ": " <<  calced[i] << endl;
    }

    // cout << "---" << endl;

    
    //??°???????????????
    vector<int> calcedRes(calced.size()+1, 0);
    for(int i=0;i<calced.size();i++){
      int tmp = (calced[i]+calcedRes[i])/(int)pow(10.0, 7);
      calcedRes[i] = (calced[i]+calcedRes[i]) - tmp*pow(10.0, 7);
      calcedRes[i+1] = tmp;
      // cout << "calcedRes[" << i  << "]: " << calcedRes[i] << ", tmp: " << tmp << endl;
    }
      
      
      
      // calcedRes[calced.size()-i-2] += tmp;
      // calced[calced.size()-i-1] -= tmp*pow(10.0, 7);

      // int tmp = calced[i-1]/(int)pow(10.0, 7);
      // calced[i-1] -= tmp;
      // calced[i] += tmp; 

    // cout << "---" << endl;

    //int to str;
    string res = "";
    for(int i=calcedRes.size()-1;i>-1;i--){
      string str = to_string(calcedRes[i]);
      // cout << i << ":" << str << endl;
      if(i==calcedRes.size()-1){
	
	if(calcedRes[i]==0){
	  continue;
	}
      }

      while(str.length()<7){
	if(i==calcedRes.size()-1){
	  break;
	}
	str += "0";
      }


      
      res += str;
    }

    // cout << "result: " << res << endl;
    cout << res << endl;
  }
}