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>
#include <sstream>

using namespace std;

inline int toInt(string s) { int v; istringstream sin(s); sin>>v; return v; }
template<class T> inline string toString(T x){ ostringstream sout; sout<<x; return sout.str(); }

#define dump(x) cerr<<#x<<" = "<<(x)<<endl;
#define debug(x) cerr<<#x<<" = "<<(x)<<"(L"<<__LINE__<<")"<<" "<<__FILE__<<endl;

int main(){
	int N; cin >> N;
	for (int i = 0; i < N; i++) {
		string a, b; cin >> a >> b;
		if (a.size() < b.size()) {
			string tmp("");
			for (int j = 0; j < b.size()-a.size(); j++) { tmp += "0"; }
			a = tmp + a;
		} else if (b.size() < a.size()) {
			string tmp;
			for (int j = 0; j < a.size()-b.size(); j++) { tmp += "0"; }
			b = tmp + b;
		}
		
		string res("");
		for (int j = 0; j < a.size()+1; j++) res += "0";
		a = "0"+a; b = "0"+b;
		for (int j = res.size()-1; j >= 0; j--) {
			int cur = 0;
			if (res[j] >= '0' && res[j] <= '9') {
				cur = res[j]-'0';
			}
			int ai = a[j]-'0', bi = b[j]-'0';
			int res_tmp = ai+bi+cur;
			if (res_tmp >= 10) { 
				res[j] = '0'+(res_tmp%10);
				res[j-1] = '0'+(res_tmp/10); 
			} else {
				res[j] = '0'+res_tmp;
			}
		}
		int j = 0;
		while (res[j] == '0') { j++; }
		string ans("");
		for (; j < res.size(); j++) ans += res[j];
		
		if (ans.size() > 80) {
			cout << "overflow" << endl;
		} else {
			cout << ans << endl;
		}
	}

	return 0;
}

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int n;
	cin >> n;
	
	while(n-- > 0){
	
	string str1;
	cin >> str1;
	
	string str2;
	cin >> str2;
	
	reverse(str1.begin(), str1.end());
	reverse(str2.begin(), str2.end());
	
	int check;
	if(str1.size() > str2.size()){
		check = 1;
	}
	else if(str1.size() == str2.size()){
		check = 2;
	}
	else {
		check = 3;
	}
	
	int ans[100];
	bool next = false;
	int short_ = min(str1.size(), str2.size());
	int long_ = max(str1.size(), str2.size());	
	if(long_ >= 80){
		cout << "overflow" << endl;
		continue;
	}

	for(int i = 0; i < short_; ++i){
		int num = 0;
		num += (str1[i] - '0') + (str2[i] - '0');
		if(next){
			num++;
		}
		ans[i] = num;
		next = false;	
		if(num >= 10){
			num -= 10;
			ans[i] -= 10;
			next = true;
		}
		//cout << num << endl;
	}
	/*for(int i = 0; i < min(str1.size(), str2.size()); ++i){
		cout << ans[i];
	}
	cout << endl;*/
	
	if(check == 1){
		for(size_t i = str2.size(); i < str1.size(); ++i){
			int num = str1[i] - '0';
			if(next){
				num++;
			}
			ans[i] = num;
			next = false;	
			if(num >= 10){
				num -= 10;
				ans[i] -= 10;
				next = true;
			}
		}
		if(next){
			ans[str1.size()] = 1;
			long_ ++;
		}
	}	
	
	if(check == 3){
		for(size_t i = str1.size(); i < str2.size(); ++i){
			int num = str2[i] - '0';
			if(next){
				num++;
			}
			ans[i] = num;
			next = false;	
			if(num >= 10){
				num -= 10;
				ans[i] -= 10;
				next = true;
			}
		}
		if(next){
			ans[str2.size()] = 1;
			long_ ++;
		}
	}
	
	if(long_ >= 80){
		cout << "overflow" << endl;
		continue;
	}

	for(int i = long_ - 1; i >= 0; --i){
		cout << ans[i];
	}/*
	for(int i = 0; i < min(str1.size(), str2.size()) + 1; ++i){
		cout << ans[i];
	}*/

	cout << endl;
	//reverse(ans.begin(), ans.end());
	//cout << ans << endl;
	}
		
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <fstream>

using namespace std;

// ツ閉カツ篠堋療アツづ個青板篠堋づ個堕ォツつオツ算ツづーツ行ツつ、
string add (string a, string b)
{
	reverse (a.begin(), a.end() );
	reverse (b.begin(), b.end() );

	while (a.length() != b.length()){
		if (a.length() > b.length()){
			b += '0';
		}else if (a.length() < b.length() ){
			a += '0';
		} // end if
	} // end while
	
	int i;
	string res = "";
	int carry = 0;
	
	for (i = 0; i < a.length(); ++i){
	
		int an = a[i] - '0';
		int bn = b[i] - '0';
		int sum = an + bn + carry;
	
		res += sum % 10 + '0';
		carry = sum/10;

	} // end for
	
	if (carry == 1){
		res += carry + '0';
	} // end if

	reverse (res.begin(), res.end() );
	
	return res;
}

int main()
{
	string str = "";
	int n;

	getline (cin, str );
	stringstream ssn(str);
	ssn >> n;

	int i;
	for (i = 0; i < n; ++i){
		string a,b;
		string res = "";

		getline (cin, a);
		getline (cin, b);

		res = add (a, b);

		if (res.length() > 80){
			cout << "overflow" << endl;
		}else{
			cout << res << endl;
		} // end if		
	} // end for

	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<vector>
#include<stack>
using namespace std;

int main()
{
  int n;
  cin >> n;
  getchar();
  while( n --){
    int i;
    int A[500] = {} , B[500] = {};
    stack<int> C;
    char a, b;
    int end;
    i = 100;
    while(1) {
      a = getchar();
      if(a == '\n') break;
      A[i] = a - '0';
      i--;
      if(i < 20) break;

    }
    int j = 100;
    while(1) {
      b = getchar();
      if(b == '\n') break;
      B[j] = b - '0';
      j--;
      if(j < 20)  break; 

    }
    if( i < 20  || j < 20 ) {  cout << "overflow" <<endl; continue; }

    if(i > j)
      end = 101 - j;
    else
      end = 101 - i;

    A[i++] += B[j++];
  
    for(int k = 0; k <= end ; i++, j++, k++) {
      A[i] += B[j];
      A[i] += A[i - 1] / 10;
      A[i - 1] %= 10;
      C.push(A[i - 1]);
    }
    if(C.top() == 0 && C.size() != 1) {
      C.pop();
    }
    end = C.size() - 1;
    if(end > 80){
      cout << "overflow" << endl;
      continue;
    }

    for(i = 0; i < end; i++) {
      cout << C.top();
      C.pop();
    }
  
    cout << endl;
  
  }
}

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

int main(){
	string a, b;
	vector<int> ans;
	int n, num, ai, bi, c=0;
	bool flag;

	cin >> n;
	
	for(int i=0 ; i<n ; i++){
		cin >> a >> b;
		flag = false;
		
		for(int j=0 ; j<100 ; j++){
			num = 0;
			ai = a.size()-j-1;
			bi = b.size()-j-1;
			if( ai<0 && bi<0 && c==0) break;
			
			if(ai>=0)num += a[ ai ] - 48;
			if(bi>=0)num += b[ bi ] - 48;
			ans.push_back( (num+c)%10 );
			if(num+c >= 10) c = 1;
			else c = 0;
		}
		if(ans.size()>80){
			flag = true;
		}
		if(flag){
			printf("overflow");
		}else{
			for(int j=ans.size()-1 ; j>=0 ; --j){
				printf("%d", ans[j]);
			}
		}
		printf("\n");
		ans.clear();
	}
	return 0;
}