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<cstring>
#include<cstdlib>

int main(void)
{
	char num1[81], num2[81];
	int n, num1_k, num2_k, rec, nnum1, nnum2, k_up, bnum1, bnum2;
	int f1, f2;
	scanf("%d", &n);
	for(f1 = 0; f1 < n; f1++)
	{
		//初期化
		k_up = 0;
		//入力
		scanf("%s", num1);
		scanf("%s", num2);
		//それぞれの桁数を求める
		num1_k = strlen(num1);
		num2_k = strlen(num2);
		bnum1 = num1_k - 1;
		bnum2 = num2_k - 1;
		//桁数で低いほうの桁数分だけ回す
		rec = (num1_k > num2_k) ? num2_k : num1_k;
		for(f2 = rec - 1; f2 >= 0; f2--)
		{
			//それぞれ現在桁の数を割り出す
			nnum1 = num1[bnum1] - '0';
			nnum2 = num2[bnum2] - '0';
			//桁数の大きいほうへ入れる
			if(num1_k > num2_k)
			{
				num1[bnum1] = ((nnum1 + nnum2) % 10 + k_up) + '0';
			}
			else
			{
				num2[bnum2] = ((nnum1 + nnum2) % 10 + k_up) + '0';
			}
			//桁上がりを求める
			k_up = (nnum1 + nnum2) / 10;
			bnum1--;
			bnum2--;
		}
		//残りの部分を求める
		rec = (bnum1 > bnum2) ? bnum1 : bnum2;
		for(f2 = rec; f2 >= 0; f2--)
		{	
			//桁数の大きいほうへ入れる
			if(num1_k > num2_k)
			{
				nnum1 = num1[f2] - '0';
				num1[f2] = ((k_up + nnum1) % 10) + '0';
				k_up = (k_up + nnum1) / 10;
			}
			else
			{
				nnum2 = num2[f2] - '0';
				num2[f2] = ((k_up + nnum2) % 10) + '0';
				k_up = (k_up + nnum2) / 10;
			}			
		}
		if(k_up == 1)
		{
			if(num1_k + 1 > 80 || num2_k + 1 > 80)
			{
				printf("overflow\n");
			}
			else
			{
				printf("%d", k_up);
			}
		}
		if(num1_k > num2_k)
		{
			printf("%s\n", num1);
		}
		else
		{
			printf("%s\n", num2);
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string.h>

using namespace std;

int main(void){
	int n;

	cin >> n;
	for(int i=0;i<n;i++){
		int len,mlen=0;
		char val[2][81]={0},tmp[81],crr=0;

		for(int j=0;j<2;j++){
			cin >> tmp;
			len = strlen(tmp);
			mlen = mlen>len?mlen:len;
			for(int k=0;k<len;k++)
				val[j][len-1-k]=tmp[k]-0x30;
		}

		cout << tmp << 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;

  scanf("%d",&n);
  rep(i,n){
    string str1, str2, res;
    cin >> str1;
    cin >> str2;

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

    rep(j,81){
      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 <algorithm>
#include <string>
using namespace std;

int main(void) {
  int N;
  cin >> N;

  while (N--) {
    int num_size;
    string num1, num2;
    cin >> num1 >> num2;

    reverse(num1.begin(), num1.end());
    reverse(num2.begin(), num2.end());

    num_size = max(num1.size(), num2.size());
    if (num_size > 80) {
      cout << "overflow" << endl;
      continue;
    }
    if (num1.size() > num2.size()) {
      int diff = num1.size() - num2.size();
      while (diff--) {
        num2 += '0';
      }
    } else {
      int diff = num2.size() - num1.size();
      while (diff--) {
        num1 += '0';
      }
    }

    string sum;
    bool flag = false;
    for (int i = 0; i < num_size; i++) {
      int n1 = num1[i] - '0';
      int n2 = num2[i] - '0';
      int tmp = n1 + n2;
      if (flag) {
        tmp++;
        flag = false;
      }
      if (tmp >= 10) {
        tmp %= 10;
        flag = true;
      }
      sum += tmp + '0';
    }

    if (sum.size() > 80) {
      cout << "overflow" << endl;
      continue;
    }
    
    reverse(sum.begin(), sum.end());
    cout << sum << endl;

  }

  return 0;
}

C++: #define scanf_s scanf
#define sscanf_s sscanf
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 81
#define _MAX 100
//#define CONSTNUM 10000000
int main(void)
{
	int n, s = 0, x, y, r = 0, a, b;
	char sum[50][_MAX], astr[_MAX], bstr[_MAX],num[11] = {"0123456789"};
	char ca, cb;
	scanf_s("%d", &n);
	for (int i = 0; i < n; ++i) {
		scanf_s("%s %s", &astr, &bstr);
		for (x = 0; astr[x] != '\0'; ++x);
		for (y = 0; bstr[y] != '\0'; ++y);

		if (x >= 80 || y >= 80) {
			printf("overflow\n");
			continue;
		}
		for (int j = 0; j < x || j < y; ++j) {
			if (j < x && j < y) {
				ca = astr[x - j - 1]; cb = bstr[y - j - 1];
				sscanf_s(&ca, "%d", &a);
				sscanf_s(&cb, "%d", &b);
				if (x > y) sum[i][x - j] = num[(a + b + r) % 10];
				else sum[i][y - j] = num[(a + b + r) % 10];
				if (a + b + r >= 10) r = (a + b + r) / 10;
				else r = 0;
			}
			else {
				if (x > y) { 
					if (r != 0) {
						ca = astr[x - j - 1];
						sscanf_s(&ca, "%d", &a);
						sum[i][x - j] = num[(a + r) % 10];
						if (a + r >= 10) r = (a + r) / 10;
						else r = 0;
					}
					else {
						sum[i][x - j] = astr[x - j - 1];
					}
				}
				else { 
					if (r != 0) {
						cb = bstr[y - j - 1];
						sscanf_s(&cb, "%d", &b);
						sum[i][y - j] = num[(b + r) % 10];
						if (b + r >= 10) r = (b + r) / 10;
						else r = 0;
					}
					else {
						sum[i][y - j] = astr[y - j - 1];
					}
				}
			}
		}
		if (y <= 80 - r || x <= 80 - r) {
			if(r == 1) 	printf("%d",r);
			for (int j = 1 ; j <= x  || j <= y; ++j) {
				printf("%c", sum[i][j]);
			}
		}
		else {
			printf("overflow");
		}
		printf("\n");
		r = 0;
	}
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>
#include<iomanip>

#define EPS (1e-10)
using namespace std;
#define PI (3.1415926535)

int main(){
	string a, b;
	vector<int> m, n, s;
	int set;

	m.resize(81, 0);
	n.resize(81, 0);
	s.resize(81, 0);

	cin >> set;
	while(set-- > 0){
		cin >> a >> b;
		for(int i = 0; i < 81; i++){
			m[i] = n[i] = s[i] = 0;
		}		
		if(a.size() > 80 || b.size() > 80){
			cout << "overflow" << endl;
		}else{
			reverse(a.begin(), a.end());
			reverse(b.begin(), b.end());
			for(int i = 0; i < a.size(); i++){
				m[i] = a[i] - '0';
			}
			for(int i = 0; i < b.size(); i++){
				n[i] = b[i] - '0';
			}
			for(int i = 0; i < 80; i++){
				s[i] += m[i] + n[i];
				if(s[i] >= 10){
					s[i+1]++;
					s[i]-=10;
				}
			}
			int digit = 81;
			while(--digit > 0){
				if(s[digit] != 0){
					break;
				}
			}
			if(digit >= 79){
				cout << "overflow" << endl;
			}else{
				for(int i = digit; i >= 0; i--){
					cout << s[i];
				}
				cout << endl;
			}
		}
	}

	return 0;
}