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<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>
#include<cfloat>
#include<cassert>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define EPS (1e-10)
using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef complex<double> P;

#define PI (3.1415926535)
#define EPS (1e-10)
class BigInteger{
private:
  void fromStr(const std::string &str){
    int len = str.size();
    int tmp = 0;

    if(str[0] == '+'){
      sign = 1;
      tmp=1;
    }else if (str[0] == '-'){
      sign = -1;
      tmp=1;
    }else{
      sign = 1;
    }

    nums = std::vector<char>(len-tmp);
    for(int i=0;i<len-tmp;i++){
      nums[i]=str[len-1-i]-'0';
    }
  }
public:
  std::vector<char> nums;
  char sign;
  /*
   * constructors
   */
  BigInteger(){sign = 1;nums = std::vector<char>(1,0);}
  BigInteger(const std::vector<char> n,char s){
    nums = n;
    assert(s == 1 || s == -1);
    sign = s;
  }
  BigInteger(const std::string &str){
    fromStr(str);
  }
  BigInteger(int n){
    char buff[16];
    sprintf(buff,"%d",n);
    fromStr(std::string(buff));
  }

  int size() const{
    return nums.size();
  }
  int len() const{
    return nums.size();
  }

  char operator [] (int n) const{
    if(n<size() && n>=0)
      return nums[n];
    else
      return 0;
  }

  const std::vector<char> &vec() const{
    return nums;
  }
  char sig() const{
    return sign;
  }
  
  std::string toString() const{
    std::string ret="";
    if(sign == -1) ret+="-";
    for(int i=nums.size()-1;i>=0;i--){
      ret+=nums[i]+'0';
    }
    return ret;
  }

  void debug() const{
    std::cout << "sign =" << (int)sign << std::endl;
    for(int i=nums.size()-1;i>=0;i--){
      std::cout << (int)nums[i] << " ";
    }
    std::cout << std::endl;
  }
};

std::ostream &operator << (std::ostream &s , const BigInteger &i){
  return s << i.toString();
}

bool operator > (const BigInteger &a,const BigInteger &b){
  char as = a.sig();
  char bs = b.sig();
  if(as == 1 && bs ==1){
    if(a.len() == b.len()){
      int i=a.len();
      while(--i != -1){
        if(a[i] != b[i]){
          return a[i] > b[i];
        }
      }
      return false;
    }else{
      return a.len() > b.len();
    }
  }else if(as == -1 && bs == -1){
    if(a.len() == b.len()){
      int i=a.len();
      while(--i != 0){
        if(a[i] != b[i]){
          return a[i] < b[i];
        }
      }
      return false;
    }else{
      return a.len() < b.len();
    }
  }else{
    return as == 1;
  }
}
bool operator < (const BigInteger &a,const BigInteger &b){
  return b > a;
}
bool operator == (const BigInteger &a,const BigInteger &b){
  char as = a.sig();
  char bs = b.sig();
  if(as != bs) return false;

  if(a.len() != b.len()){
    return false;
  }else{
    for(int i=0;i<a.len();i++){
      if(a[i]!=b[i]) return false;
    }
  }
  return true;
}

bool operator != (const BigInteger &a,const BigInteger &b){
  return !(a==b);
}

/* operator */
BigInteger operator - (const BigInteger &a){
  return BigInteger(a.vec(),-a.sig());
}

BigInteger operator + (const BigInteger &a,const BigInteger &b){
  int lena = a.size();
  int lenb = b.size();
  int maxlen = std::max(lena,lenb);
  std::vector<char> v = std::vector<char>(maxlen+1,0);
  int sig = 1;

  for(int i=0;i<maxlen;i++){
    v[i] += a.sig()*a[i]+b.sig()*b[i];
    while(v[i] < 0){
      v[i+1]--;
      v[i]+=10;
      std::cout << "test" << std::endl;
    }
    if(v[i] >=10){
      v[i+1] = v[i]/10;
      v[i]%=10;
    }
  }

  if(v[maxlen]<0){
    sig = -1;
    for(int i=0;i<maxlen;i++){
      v[i]=-v[i];
      while(v[i]<0){
        v[i+1]++;
        v[i]+=10;
      }
    }
    v[maxlen]=-v[maxlen];
  }

  int pos=v.size();
  while(pos!=1 && v[pos-1]==0) pos--;
  if(pos != v.size()) v.resize(pos);
  
  return BigInteger(v,sig);
}

BigInteger operator + (const BigInteger &a,int b){
  return a+BigInteger(b);
}


BigInteger &operator += (BigInteger &a,const BigInteger &b){
  a = a+b;
  return a;
}
BigInteger &operator += (BigInteger &a,int b){
  a = a+b;
  return a;
}

BigInteger &operator ++ (BigInteger &a){
  a = a + BigInteger(1);
  return a;
}

BigInteger operator - (const BigInteger &a,const BigInteger &b){
  return a + (- b); 
}

BigInteger operator * (const BigInteger &a,const BigInteger &b){
  int len = a.size() + b.size() + 2;
  int sign = a.sig()*b.sig();

  std::vector<char> v(len);

  for(int i=0;i<a.size();i++){
    if(a[i] == 0) continue;
    for(int j=0;j<b.size();j++){
      v[i+j] += a[i]*b[j];
      if(v[i+j] >=10){
        v[i+j+1] = v[i+j]/10;
        v[i+j]%=10;
      }
    }
  }

  int pos=v.size();
  while(pos!=1 && v[pos-1]==0) pos--;
  if(pos != v.size()) v.resize(pos);

  return BigInteger(v,sign);
}

BigInteger operator * (const BigInteger &a,int b){
  return a*BigInteger(b);
}

BigInteger &operator *= (BigInteger &a,const BigInteger &b){
  a = a*b;
  return a;
}
BigInteger &operator *= (BigInteger &a,int b){
  a = a*b;
  return a;
}

BigInteger reverse(const BigInteger &a){
  BigInteger b=a;
  std::reverse(b.nums.begin(),b.nums.end());
  return b;
}

BigInteger power(BigInteger a,int b){
  if(b == 0) return BigInteger(1);
  if((b&1) != 0){
    return a*power(a*a,b>>1);
  }else{
    return power(a*a,b>>1);
  }
}

int main(){
  int n; cin>>n;
  while(n-->0){
    string s1,s2;
    cin>>s1>>s2;
    BigInteger b1(s1), b2(s2);
    BigInteger a = b1+b2;
    if(a.len() > 80)
      cout << "overflow" << endl;
    else
      cout << a << endl;
  }
  return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <iostream>

using namespace std;

const int N = 85;

char a[N], b[N];

void reverse(char a[]) {
	int len = strlen(a);
	for (int i=0, j=len-1; i<j; ++i, --j) {
		char tmp = a[i];
		a[i] = a[j];
		a[j] = tmp;
	}
}

void add(char a[], char b[]) {
	int lenA = strlen(a);
	int lenB = strlen(b);
	int i, j, tmp, jin = 0;
	for (i=0; i<lenA && i<lenB; ++i) {
		tmp = (a[i] - '0') + (b[i] - '0') + jin;
		a[i] = tmp % 10 + '0';
		jin = tmp / 10;  
	}
	if (!a[i] && !b[i] && jin) {
		a[lenA] = jin + '0';
		a[lenA + 1] = '\0';
	}
	else if (a[i] && !b[i]) {
		for (; i<lenA; ++i) {
			tmp = a[i] - '0' + jin;
			a[i] = tmp % 10 + '0';
			jin = tmp / 10;
		}
		if (jin) {
			a[lenA] = jin + '0';
			a[lenA + 1] = '\0';
		} 
	}
	else if (!a[i] && b[i]) {
		for (; i<lenB; ++i) {
			tmp = b[i] - '0' + jin;
			a[i] = tmp % 10 + '0';
			jin = tmp / 10;
		}
		if (jin) {
			a[lenB] = jin + '0';
			a[lenB + 1] = '\0';
		}
		else a[lenB] = '\0';
	}
}

int main() {
	int t;
	scanf ("%d", &t);
	while (t--) {
		scanf ("%s%s", a, b);
		if (strlen(a) > 80 || strlen(b) > 80) printf ("overflow\n");
		else {
			reverse(a);
			reverse(b);
			add(a, b);
			if (strlen(a) > 80) printf ("overflow\n");
			else reverse(a), printf ("%s\n", a);
		}
	}
	return 0;
}