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<algorithm>
#include<string>
using namespace std;
int main() {
	int n;
	cin >> n;
	string k, l;
	for(int j=0;j<n;j++) {
		int c = 0, d;
		cin >> k >> l;
		string g = "";
		string a="", b="";
		for (int i = k.length() - 1; i >= 0; i--) 
			a += k[i];
		for (int i = l.length()-1; i >= 0; i--)
			b += l[i];
		for (int i = 0; i < max(a.length(), b.length()) + 1; i++) {
			if (i < min(a.length(), b.length())) {
				int e = (int)a[i] - '0', f = (int)b[i] - '0';
				d = e + f + c;
				if (d >= 10) {
					g += (char)(d - 10) + '0';
					c = 1;
				}
				else {
					g += (char)d + '0';
					c = 0;
				}
			}
			else if (i < a.length()) {
				int e = (char)a[i] - '0';
				e += c;
				if (e >= 10) {
					g += (char)(e - 10) + '0';
					c = 1;
				}
				else {
					g += (char)e + '0';
					c = 0;
				}
			}
			else if (i < b.length()) {
				int e = (char)b[i] - '0';
				e += c;
				if (e >= 10) {
					g += (char)(e - 10) + '0';
					c = 1;
				}
				else {
					g += (char)e + '0';
					c = 0;
				}
			}
			else if (c == 1) {
				g += (char)c + '0';
				c = 0;
			}
		}
		string h = "";
		if (g.length() >= 81)
			cout << "overflow" << endl;
		else {
			for (int i = g.length() - 1; i >= 0; i--)
				h +=g[i];
			cout << h << endl;
		}
	}
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
 string s1,s2;
 int a1[100],a2[100],i,n,l1,l2,l;
 cin>>n;
 while(n--){
   cin>>s1>>s2;
   l1=s1.size();
   l2=s2.size();
   for(i=l1-1;i>-1;i--)
     a1[i]=int(s1[l1-i-1])-int('0');
   for(i=l2-1;i>-1;i--)
     a2[i]=int(s2[l2-i-1])-int('0');
   if(l1>l2)
     l=l1;
   else
     l=l2;
   for(i=0;i<l;i++){
     a1[i]=(a1[i]+a2[i])%10;
     a1[i+1]+=(a1[i]+a2[i])/10;
   }
   if (a1[l]==1)
    ++l;
   if (l<=80){
     for(i=l-1;i>-1;i--)
       cout<<a1[i];
       cout<<endl;
   }
   else {
     cout<<"overflow"<<endl;
     continue;
   }
 }
 return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <cassert>
#include <string>
#include <cstring>
#include <algorithm>

using namespace std;

typedef long long ll;

const ll BASE = 10000;
const int LogB = 4;
const int MAX_DIGIT = 100;

struct Bigint {
	ll digit[MAX_DIGIT];
	int size;
	Bigint (int sz = 1, ll a = 0) : size(sz) {
		memset(digit, 0, sizeof(digit));
		digit[0] = a;
	}
};

const Bigint ZERO(1,0), ONE(1, 1);

bool operator < (Bigint x, Bigint y) {
	if (x.size != y.size) return x.size < y.size;
	for (int i=x.size-1; i>=0; i--) if (x.digit[i] != y.digit[i]) return x.digit[i] < y.digit[i];
	return false;
}

bool operator > (Bigint x, Bigint y) { return y < x; }
bool operator <= (Bigint x, Bigint y) { return !(y < x); }
bool operator >= (Bigint x, Bigint y) { return !(x < y); }
bool operator != (Bigint x, Bigint y) { return x < y || y < x; }
bool operator == (Bigint x, Bigint y) { return !(x < y) && !(y < x); }

Bigint normal(Bigint x) {
	ll c = 0;
	for (int i=0; i<x.size; i++) {
		while (x.digit[i] < 0)
			x.digit[i+1] -= 1, x.digit[i] += BASE;
		ll a = x.digit[i] + c;
		x.digit[i] = a % BASE;
		c = a / BASE;
	}
	for (; c>0; c /= BASE) x.digit[x.size++] = c % BASE;
	while (x.size > 1 && x.digit[x.size-1] == 0) x.size--;
	return x;
}

Bigint convert(ll a) { return normal(Bigint(1, a)); }

Bigint convert(const string& s) {
	Bigint x;
	int i = s.size() % LogB;
	if (i > 0) i -= LogB;
	for (; i<(int)s.size(); i += LogB) {
		ll a = 0;
		for (int j=0; j<LogB; j++) a = 10 * a + (i+j >= 0 ? s[i+j] - '0' : 0);
		x.digit[x.size++] = a;
	}
	reverse(x.digit, x.digit+x.size);
	return normal(x);
}

ostream &operator << (ostream& os, Bigint x) {
	os << x.digit[x.size-1];
	for (int i=x.size-2; i>=0; i--) os << setw(LogB) << setfill('0') << x.digit[i];
	return os;
}

istream &operator >> (istream& is, Bigint &x) {
	string s; is >> s;
	x = convert(s);
	return is;
}

Bigint operator + (Bigint x, Bigint y) {
	if (x.size < y.size) x.size = y.size;
	for (int i=0; i<y.size; i++) x.digit[i] += y.digit[i];
	return normal(x);
}

int main() {
	int n;
	cin >> n;
	string s1, s2;
	
	for (int i=0; i<n; i++) {
		cin >> s1;
		cin >> s2;
		Bigint x = convert(s1), y = convert(s2);
		Bigint z = x + y;
		if (z.size > 80) cout << "overflow" << endl;
		else cout << z << endl;
	}
	
	return 0;
}

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=str.length();i>0;i-=n){
    // cout << "i: " << i << ", i-n:" << i-n << ", i-1:" << i-1 << " ";
    if(i-n > 0){
      cout << "str.substr: " << str.substr(i-n, n) << endl;
      tmp.push_back(str.substr(i-n, n));
    }
    else{
      cout << "str.substr: " << str.substr(0, i) << endl;
      tmp.push_back(str.substr(0, i));
    }
  }
  
  // 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 || i==calcedRes.size()-2){
	  break;
	}
	str += "0";
      }


      
      res += str;
    }

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