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 <cstdio>
#include <map>
using namespace std;

int get_length(char *data) {
	for (int i = 0;; i++) {
		if (data[i] == '\0') {
			return i;
		}
	}
	return 0;
}

bool is_more_ten(char *d) {
	if (d[0] == 'X' || d[0] == 'A' || d[0] == 'B' || d[0] == 'C' ||
		d[0] == 'D' || d[0] == 'E' || d[0] == 'F' || d[0] == 'G' ||
		d[0] == 'H') {
		return true;
	}
	return false;
}

void shift(char *data, int length) {
	for (int i = length; i != -1; i--) {
		data[i+1] = data[i];
	}
}

int main(int argc, char *argv[]) {
	int dataN;
	
	map<char, int> chr2int;
	chr2int.insert(map<char, int>::value_type('0',0));
	chr2int.insert(map<char, int>::value_type('1',1));
	chr2int.insert(map<char, int>::value_type('2',2));
	chr2int.insert(map<char, int>::value_type('3',3));
	chr2int.insert(map<char, int>::value_type('4',4));
	chr2int.insert(map<char, int>::value_type('5',5));
	chr2int.insert(map<char, int>::value_type('6',6));
	chr2int.insert(map<char, int>::value_type('7',7));
	chr2int.insert(map<char, int>::value_type('8',8));
	chr2int.insert(map<char, int>::value_type('9',9));
	chr2int.insert(map<char, int>::value_type('X',10));
	chr2int.insert(map<char, int>::value_type('A',11));
	chr2int.insert(map<char, int>::value_type('B',12));
	chr2int.insert(map<char, int>::value_type('C',13));
	chr2int.insert(map<char, int>::value_type('D',14));
	chr2int.insert(map<char, int>::value_type('E',15));
	chr2int.insert(map<char, int>::value_type('F',16));
	chr2int.insert(map<char, int>::value_type('G',17));
	chr2int.insert(map<char, int>::value_type('H',18));
	chr2int.insert(map<char, int>::value_type('I',19));
	
	map<char, int> end_chr2int;
	end_chr2int.insert(map<char, int>::value_type('X',0));
	end_chr2int.insert(map<char, int>::value_type('A',1));
	end_chr2int.insert(map<char, int>::value_type('B',2));
	end_chr2int.insert(map<char, int>::value_type('C',3));
	end_chr2int.insert(map<char, int>::value_type('D',4));
	end_chr2int.insert(map<char, int>::value_type('E',5));
	end_chr2int.insert(map<char, int>::value_type('F',6));
	end_chr2int.insert(map<char, int>::value_type('G',7));
	end_chr2int.insert(map<char, int>::value_type('H',8));
	end_chr2int.insert(map<char, int>::value_type('I',9));
	
	const char int2chr[] = {
		'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 
		'X', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'
	};
	
	fscanf(stdin, "%d", &dataN);
	for (int i = 0; i < dataN; i++) {
		char buf1[1000], buf2[1000], sum[1000];
		int buf1_cnt, buf2_cnt, longer;
		// scan
		fscanf(stdin, "%s", buf1);
		fscanf(stdin, "%s", buf2);
		buf1_cnt = get_length(buf1);
		buf2_cnt = get_length(buf2);
		// is overflow ?
		if (buf1_cnt > 80 || buf2_cnt > 80 || buf1_cnt == 0 || buf2_cnt == 0) {
			puts("overflow");
			continue;
		}
		
		if (buf1_cnt > buf2_cnt) {
			sum[buf1_cnt] = '\0';
			longer = buf1_cnt;
			int idx = buf1_cnt-1;
			int diff = buf1_cnt - buf2_cnt;
			for (int i = buf2_cnt-1; i != -1 ; i--) {
				int t_sum = chr2int[buf1[idx]] + chr2int[buf2[i]];
				if (t_sum > 9) {
					buf1[idx-1] = int2chr[chr2int[buf1[idx-1]]+1];
					t_sum %= 10;
				}
				sum[idx] = int2chr[t_sum];
				idx--;
			}
			for (int i = diff-1; i != -1; i--) {
				int t_sum = chr2int[buf1[i]];
				if (i != 0) {
					if (t_sum > 9) {
						buf1[i-1] = int2chr[chr2int[buf1[i-1]]+1];
						t_sum %= 10;
					}
				}
				sum[i] = int2chr[t_sum];
			}
		}
		else if (buf1_cnt < buf2_cnt) {
			longer = buf2_cnt;
			sum[buf2_cnt] = '\0';
			int idx = buf2_cnt-1;
			int diff = buf2_cnt - buf1_cnt;
			for (int i = buf1_cnt-1; i != -1 ; i--) {
				int t_sum = chr2int[buf1[idx]] + chr2int[buf2[i]];
				if (t_sum > 9) {
					buf2[idx-1] = int2chr[chr2int[buf2[idx-1]]+1];
					t_sum %= 10;
				}
				sum[idx] = int2chr[t_sum];
				idx--;
			}
			for (int i = diff-1; i != -1; i--) {
				int t_sum = chr2int[buf2[i]];
				if (i != 0) {
					if (t_sum > 9) {
						buf2[i-1] = int2chr[chr2int[buf2[i-1]]+1];
						t_sum %= 10;
					}
				}
				sum[i] = int2chr[t_sum];
			}
		}
		else {
			longer = buf1_cnt;
			sum[buf2_cnt] = '\0';
			int idx = buf2_cnt-1;
			int diff = buf2_cnt - buf1_cnt;
			for (int i = buf1_cnt-1; i != -1 ; i--) {
				int t_sum = chr2int[buf1[idx]] + chr2int[buf2[i]];
				if (t_sum > 9) {
					if (i != 0) {
						buf2[idx-1] = int2chr[chr2int[buf2[idx-1]]+1];
						t_sum %= 10;
					}
				}
				sum[idx] = int2chr[t_sum];
				idx--;
			}
		}
		// check most left number
		if (is_more_ten(sum)) {
			if (buf1_cnt == 80 || buf2_cnt == 80) {
				puts("overflow");
				continue;
			}
			shift(sum, longer);
			sum[0] = '1';
			sum[1] = int2chr[end_chr2int[sum[1]]];
		}
		printf("%s\n", sum);
	}
	
	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<string>
#include<vector>
#include<algorithm>
using namespace std;

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

   vector<int> V;

   for(int i = 0; i < n; i++){
     string a, b;
     int slength[2];

    
     cin >> a >> b;

     slength[0] = a.length();
     slength[1] = b.length();


     if(a.length() != 1)reverse(a.begin(), a.end());
     if(b.length() != 1)reverse(b.begin(), b.end());

     if(a.length() > b.length()){
       for(int j = 0; j < slength[0] - slength[1]; j++) b+="0";
     }else{
       for(int j = 0; j < slength[1] - slength[0]; j++) a+="0";
     }
     int flag = 0;

     for(int j = 0; j < a.length(); j++){
       if(flag){
	 a[j]++;
	 flag--;
       }
       if((a[j]+b[j]-96)/10 == 0){
	 V.push_back(a[j]+b[j]-96);
       }else{
	 flag++;
	 V.push_back((a[j]+b[j]-96)%10);
       }
     }
 
     if(flag) V.push_back(1);

     for(int j = V.size()-1; j >= 0; j--){
       cout << V[j];
     }
     cout << endl;
     V.clear();
   }  
   return 0;
}