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 <stdio.h>
#include <string.h>

#define BUF_SIZE 256

int main(void) {
	char buf[BUF_SIZE];
	char num1[100];
	char num2[100];
	char sum[100];
	char str[100];
	int n;
	int i, j, k;
	
	fgets(buf, sizeof(buf), stdin);
	sscanf(buf, "%d", &n);
	
	for (i=0; i<n; i++) {
		for (j=0; j<100; j++) {
			num1[j] = num2[j] = sum[j] = 0;
		}
		
		// first integer
		fgets(buf, sizeof(buf), stdin);
		sscanf(buf, "%s", &str);
		if (strlen(str) > 80) {
			printf("overflow\n");
			continue;
		}
		
		for (j=0; j<strlen(str); j++)  ;
		for (k=0; j>0; k++) {
			j--;
			num1[k] = str[j] - '0';
		}
		
		// second integer
		fgets(buf, sizeof(buf), stdin);
		sscanf(buf, "%s", &str);
		if (strlen(str) > 80) {
			printf("overflow\n");
			continue;
		}
		
		for (j=0; j<strlen(str); j++)  ;
		for (k=0; j>0; k++) {
			j--;
			num2[k] = str[j] - '0';
		}
		
		// sum
		for (j=0; j<80; j++) {
			sum[j] += num1[j]+num2[j];
			if (sum[j] >= 10) {
				sum[j+1]++;
				sum[j] = sum[j]%10;
			}
		}
		
		if (sum[80] != 0) {
			printf("overflow\n");
		}
		else {
			for (j=79; sum[j]==0 && j>=1; j--)  ;
			for (; j>=0; j--) {
				printf("%d", sum[j]);
			}
			printf("\n");
		}
	}
	
	return 0;
}

C++: #include <iostream>
#include <string.h>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int main(){
  int n, maxlen;
  char a[100], b[100];

  cin >> n;
  for(int ii = 0 ; ii < n ; ii++){
    string ans = "";
    scanf("%s%s", a, b);
    
    maxlen = max(strlen(a), strlen(b));

    reverse(a, a+strlen(a));
    reverse(b, b+strlen(b));
    
    for(int i = strlen(a) ; i < 100 ; i++){
      a[i] = '0';
    }
    for(int i = strlen(b) ; i < 100 ; i++){
      b[i] = '0';
    }

    int tmp, tmp2 = 0;
    bool flag = 0;

    for(int i = 0 ; i < maxlen ; i++){
      tmp = (a[i] - '0') + (b[i] - '0') + tmp2;
      
      if(i == maxlen - 1){
	//cout << "OK" << endl;
	//tmp = (a[i] - '0') + (b[i] - '0') + tmp2;
	if(tmp >= 10){
	  tmp2 = 1;
	  tmp -= 10;
	  ans += tmp + '0';
	  ans += '1';
	}
	else ans += tmp + '0';
      }

      else if(tmp >= 10){
	tmp2 = 1;
	tmp -= 10;
	ans += tmp + '0';
      }
      else if(tmp <= 9){
	ans += tmp + '0';
	tmp2 = 0;
      }
    }

    reverse(ans.begin(), ans.end());
   
    if(ans.size() >= 80) cout << "overflow" << endl;
    else cout << ans << endl;
  }
  return 0;
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define np string::npos
#define X real()
#define Y imag()
#define value(x,y,w,h) (x >= 0 && x < w && y >= 0 && y < h)
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define repc(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

typedef long long ll ;
typedef deque<int> di ;
typedef deque<ll> dl ;
typedef map<string,int> dict;
typedef complex<double> comd;
typedef pair<int,int> pii;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

double CalcDist(comd p1, comd p2){
  return sqrt(pow(p1.X - p2.X,2.0) + pow(p1.Y -p2.Y,2.0));
}

  template <typename T>
void out(deque < T > d)
{
  for(size_t i = 0; i < d.size(); i++)
  {
    debug(d[i]);
  }
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

unsigned long long int ulli;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  string s1,s2,ans(1000,' ');
  cin >> N;
  rep(i,N){
    cin >> s1 >> s2;
    ans = string(1000,' ') ;
    if(s1.size()> 80 || s2.size() > 80){
      cout << "overflow" << endl;
      continue;
    }
    int a,b,c = 0;
    bool f = s1.size() >= s2.size();
    for(int i = 0;i <min(s1.size(),s2.size());++i){
      if(f){
        a = s1[s1.size()-1-i] - '0' ;
        b = s2[s2.size()-1-i] - '0' ;
      }
      else{
        a = s1[s1.size()-1-i] - '0' ;
        b = s2[s2.size()-1-i] - '0' ;
      }
//       debug((a+b+c)%10+'0');
      ans[ans.size()-1-i] = (a+b+c)%10+'0';
      c = (a+b+c)/10;
//       cout << ans.size()-1-i << " :" << a << " :" << b << " :" << c <<endl;
    }
    for(int i = min(s1.size(),s2.size()); i < max(s1.size(),s2.size());++i){
      if(f){
        ans[ans.size()-1-i] = (s1[s1.size()-1-i] - '0' + c)%10+'0';
        c = (s1[s1.size()-1-i] - '0' + c )/10;
      }
      else{
        ans[ans.size()-1-i] = (s2[i] + c - '0')%10+'0';
        c = (s2[i] + c - '0')/10;
      }
    }
    if(c > 0){
//       cout << ans << "c :"<<  c << endl;
      ans[0] = c +'0' ;
    }
    if(ans.size()-count(all(ans),' ') > 80){
      cout << "overflow" << endl;
      continue;
    }
    for(size_t c = ans.find_first_of(" "); c != string::npos; c = ans.find_first_of(" ")){
      ans.erase(c,1);
    }
    cout << ans << 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 {
    if (m_digits.size() >= 80) {
      return "overflow";
    }
    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;
        } else {
          inc = 0;
        }
        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;
        } else {
          inc = 0;
        }
        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;
}