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 <string>
using namespace std;

int main() {
   int n;
   string str_a;
   string str_b;
   string sum = "";

   scanf("%d", &n);
   for(int i=0; i < n; ++i){
       cin >> str_a >> str_b;

   int id_a = str_a.size();
   int id_b = str_b.size();
   int c = 0;

   // ???????????????????????°?????????????????????
   while (id_a > 0 || id_b > 0) {
     int a = 0, b = 0;
     // int??§??°???????????????
     if (id_a > 0) a = str_a[--id_a] - '0';
     if (id_b > 0) b = str_b[--id_b] - '0';
     // ?????¨???????????°???????????????c?????????????????????????????°???????????????
     sum = to_string(((a + b + c) % 10)) + sum;
     // ?¬???????????????°????????????????¨????
     c = (a + b + c) / 10;
   }
   if (c > 0) sum = to_string(c) + sum;
   cout << sum << endl;
   sum = "";
   }
}

C++: #include <algorithm>
#include <string>
#include <iostream>

using namespace std;

/** Problem0015 : National Budget **/
int main()
{
	string a, b, s;
	int n, tmp, la, lb;
	bool up=false;
	
	cin >> n;
	for (int i=0; i<n; i++) {
		cin >> a >> b;
		s="";
		
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());
		la=(int)a.length();
		lb=(int)b.length();
		
		if (la < lb) {
			swap(la, lb);
			swap(a, b);
		}
		
		for (int i = 0; i<la-lb; i++) b+='0';
		
		for (int i=0; i<la; i++) {
			tmp = (a[i]-'0') + (b[i] - '0') + (up?1:0);
			if (tmp>=10) {
				s += '0'+tmp%10;
				up = true;
			} else {
				s += '0'+tmp;
				up = false;
			}
		}
		
		if (up)
			s+='1';
		reverse(s.begin(), s.end());
		if (s.length()>80)
			cout << "overflow" << endl;
		else
			cout << s << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int main(){
  int n;
  char a[101];
  char b[101];
  int temp;
  int p = 0;
  int i;
  int flag;
  cin >> n;
  while(p < n){
    flag = 0;
    for(i = 0;i < 101;i++){
      a[i] = '0';
      b[i] = '0';
    }
    scanf("%s %s",a,b);
    temp = 100;
    for(i = strlen(a) - 1;i >= 0;i--){
      a[temp] = a[i];
      a[i] = '0';
      temp--;
    }
    temp = 100;
    for(i = strlen(b) - 1;i >= 0;i--){
      b[temp] = b[i];
      b[i] = '0';
      temp--;
    }
    for(i = 100;i >= 0;i--){
      a[i] += b[i] - '0';
      if(a[i] > '9'){
	a[i - 1]++;
	a[i] -= 10;
      }
    }
    for(i = 0;i < 101;i++){
      if(a[i] >= '1')flag = 1;
      if(flag || i == 100){
	cout << a[i];
      }
    }
    cout << endl;
    p++;
  }
  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(itr,c) 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;
  int len1, len2;
  char tmp;

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

    vector<int> a(100, 0), b(100, 0);
    len1 = str1.size(); len2 = str2.size();
    rep(j,len1) a[j] = str1[len1-1-j] - '0';
    rep(j,len2) b[j] = str2[len2-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());
    int f = 0;
    rep(j,res.size()){
      if(res[j] != '0') f = 1;
      if(f) cout << res[j];
    }

    cout << endl;
  }

  return 0;
}

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

#define MAX_DIGIT 80

void add(char *buf1, char *buf2){
	int len1 = strlen(buf1);
	int len2 = strlen(buf2);
	if(len1 > MAX_DIGIT || len2 > MAX_DIGIT){
		printf("overflow\n");
		return;
	}
	
	int out[MAX_DIGIT + 2];
	int i = 0;
	int carry = 0;
	while(len1 > 0 || len2 > 0){
		out[i] = carry;
		if(len1 > 0){
			len1--;
			out[i] += buf1[len1] - '0';
		}
		if(len2 > 0){
			len2--;
			out[i] += buf2[len2] - '0';
		}
		if(out[i] >= 10){
			carry = 1;
			out[i] -= 10;
		}else{
			carry = 0;
		}
		i++;
	}
	if(carry > 0){
		out[i] = carry;
	}else{
		i--;
	}
	if(i >= MAX_DIGIT){
		printf("overflow\n");
		return;
	}
	for(; i >= 0; i--){
		printf("%d", out[i]);
	}
	printf("\n");
}

int main(){
	int n;
	char buf1[10000], buf2[10000];
	
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%s", buf1);
		scanf("%s", buf2);
		add(buf1, buf2);
	}
	
	return 0;
}