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

int main(void){
  int N;
  scanf("%d", &N);

  int i,j,k;
  for(i=0; i<N; ++i){
    int digits[3][81];
    for(j=0; j<3; ++j){
      for(k=0; k<81; ++k){
        digits[j][k] = 0;
      }
    }

    int overflow = 0;
    for(j=0; j<2; ++j){
      char digit[80];
      scanf("%s", digit);
      if(overflow || strlen(digit)>80){
        overflow = 1;
      }else{
        for(k=0; k<strlen(digit); ++k){
          digits[j][k] = digit[strlen(digit)-1-k]-'0';
        }
      }
    }
    if(overflow){
      printf("overflow\n");
    }else{
      for(j=0; j<80; ++j){
        digits[2][j] += (digits[0][j]+digits[1][j]);
        digits[2][j+1] += digits[2][j]/10;
        digits[2][j] %= 10;
      }

      if(digits[2][80]>0){
        printf("overflow\n");
      }else{
        int flag = 0;
        for(j=80; j>=0; --j){
          if(flag || digits[2][j]!=0 || j==0){
            flag = 1;
            printf("%d", digits[2][j]);
          }
        }
        printf("\n");
      }
    }
  }
  
  return 0;
}

C++: #include <iterator>
#include <typeinfo>
#include <list>
#include <map>     
#include <numeric>
#include <utility>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <iostream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define rep(a,t) for(int a=0;a<t;++a) 
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
#define pb push_back
#define int_maxvalue numeric_limits<int>::max()
ll mod = 1e9 + 7;
string Addition(string a,string b) {
	string ans = "";
	int bef = 0;
	int be1 = 0;
	for (int i = a.length() - 1; i >= 0; i--) {
		int added = stoi(a.substr(i, 1)) + stoi(b.substr(i, 1))+be1;

		if (added >= 10) {
			bef = 1;
			added -= 10;
		}
		else {
			bef = 0;
		}
		stringstream ss;
		ss << added;

		ans = ss.str()+ans;
		if (i == 0) 
		{
			break;
		}
		be1 = bef;
	}
	if (be1 == 1) {
		ans = "1" + ans;
	}
	return ans;
}
int main() {
	int n;
	cin >> n;
	rep(o1, n) {
		string a, b;
		cin >> a >> b;
		if (a.length() < b.length()) {
			swap(a, b);
		}
		string b1 = b;
		for (int i = 0; i < a.length() - b1.length(); ++i) {
			b = '0' + b;
		}
		string ans = Addition(a, b);
		if (ans.length() > 80) { cout << "overflow" << endl; }
		else {
			cout << ans << endl;
		}
	}
	return 0;
}

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

using namespace std;

#define REP(i,a,b) for((i)=(a);(i)<(int)(b);(i)++)
#define rep(i,n) REP(i,0,n)
// BEGIN CUT HERE
#define foreach(c,itr) for(typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
// END CUT HERE

int main(){
  int i, j, n;

  cin >> n;
  rep(i,n){
    string str1, str2, res = "";
    cin >> str1;
    cin >> str2;

    vector<int> a(80, 0);
    rep(j,str1.length()) a[j] = str1[str1.length()-1-j] - '0';

    vector<int> b(80, 0);
    rep(j,str2.length()) b[j] = str2[str2.length()-1-j] - '0';

    rep(j,80){
      int sum = a[j] + b[j];
      if(sum >= 10){ sum %= 10; a[j+1]++;}
      res += (sum + '0');
    }

    reverse(res.begin(), res.end());
    bool f = false;
    rep(j,res.length()){
      if(res[j] != '0') f = true;
      if(f) cout << res[j];
    }
    cout << endl;
  }

  return 0;
}

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

int charToInt(char);
string sumStr(string, string);

int charToInt(char c) {
  return (int)c - (int)'0';
}

string sumStr(string a, string b) {
  int pa = a.length()-1, pb = b.length()-1;
  string str(83, '0');
  int pstr = str.length()-1;
  int next = 0;
  while(pa >= 0 && pb >= 0) {
    int temp = charToInt(a[pa]) + charToInt(b[pb]) + next;
    next = temp / 10;
    str[pstr] = (char)(temp%10+(int)'0');

    pa--;
    pb--;
    pstr--;
  }
  while(pa >= 0) {
    int temp = charToInt(a[pa]) + next;
    next = temp / 10;
    str[pstr] = (char)(temp%10+(int)'0');

    pa--;
    pstr--;
  }
  while(pb >= 0) {
    int temp = charToInt(b[pb]) + next;
    next = temp / 10;
    str[pstr] = (char)(temp%10+(int)'0');

    pb--;
    pstr--;
  }
  str[pstr] = (char)(next + (int)'0');

  for(int i = 0; i < str.length(); i++) {
    if(str[i] != '0') {
      return str.substr(i, str.length()-i);
    }
  }
  return "0";
}

int main() {
  int N;
  cin >> N;
  for(int i = 0; i < N; i++) {
    bool overflow = false;
    int data[N][8];
    string sum;
    for(int j = 0; j < 2; j++) {
      string str;
      cin >> str;
      if(str.length() > 80) overflow = true;
      if(!overflow) {
	if(j == 0) sum = str;
	else       sum = sumStr(sum, str);
        if(sum.length() > 80) overflow = true;
      }
    }

    if(overflow) cout << "overflow" << endl;
    else         cout << sum << endl;
  }
  return 0;
}

C++: test

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

string f(string a, string b, int c) {
  if (!a.size()) return c ? string(1, c + '0') : "";
  int ia = a.back() - '0', ib = b.back() - '0';
  int s = ia + ib + c;
  c     = s / 10;
  a.pop_back(),
    b.pop_back();
  return f(a, b, c) + char(s % 10 + '0');
}

void solve() {
  int n;
  cin >> n;
  rep(_, n) {
    string a, b;
    cin >> a >> b;
    while (a.size() < b.size()) a = "0" + a;
    while (a.size() > b.size()) b = "0" + b;
    string x                      = f(a, b, 0);
    cout << (x.size() > 80 ? "overflow" : x) << endl;
  }
}