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<cstdio>
#include<cstring>
using namespace std;
char ans[101];
char n1[101];
char n2[101];
int main(){
	int d;
	int h1,h2,limit;
	for(cin>>d;d>0;d--){
		for(int j=0;j<100;j++)ans[j]='0';
		scanf("%s",n1);
		scanf("%s",n2);
		h1=strlen(n1)-1;
		h2=strlen(n2)-1;
		limit=max(h1,h2);
		int i;
		bool flg=false;
		for( i=0;i<=limit;i++,h1--,h2--){
			flg=false;
			int n1_tmp = 0;
			int n2_tmp = 0;
			if(h1>=0){
				n1_tmp=n1[h1]-'0';
			}
			if(h2>=0){
				n2_tmp=n2[h2]-'0';
			}
			int sum = n1_tmp + n2_tmp;
			if(sum>=10){
				if(i==79){
					i++;
					flg=true;
					break;
				}
				ans[i+1]+=1;
				sum=sum%10;
				flg=true;
			}

			if(ans[i]-'0'+sum > 9){
				if(i==79){
					i++;
					flg=true;
					break;
				}
				ans[i]=ans[i]+(sum-10);
				ans[i+1]+=1;
				flg=true;
			}
			else ans[i]+=sum;
		}
		if(flg){
			i++;
		}
		ans[i]='\0';
		if(i>=80)cout<<"overflow"<<endl;
		else{
			for(--i;i>=0;i--){
				if(i>=0)cout<<ans[i];
			}
			cout<<endl;
		}
//		cout<<"size:"<<strlen(ans)<<endl;
	}
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string.h>
#include <queue>
#include <stack>
#include <utility>
#include <queue>
#define mp make_pair
#define pii pair<int,int> 
#define ff first
#define ss second

using namespace std;

int t,temp1,temp2,tempc;
char a[1000],b[1000];
char temp[1000];
int c[1000];

int addition(int n1,int n2)
{
	//printf("%d,%d ",n1,n2);
	if(n1>=n2)
	{
		if(n2!=-1)
		{
			temp1=(int)a[n1]-48;
			temp2=(int)b[n2]-48;
			tempc=temp1+temp2;
			//printf("%d,%d,%d",temp1,temp2,tempc);
			if(tempc+c[n1+1]>=10)
			{
				tempc-=10;
				c[n1]+=1;
			}
			c[n1+1]+=tempc;
			//printf("%d,%d",c[n1+1],tempc);
			addition(n1-1,n2-1);
		}
		else if(n1!=-1)
		{
			tempc=(int)a[n1]-48;
			if(tempc+c[n1+1]>=10)
			{
				c[n1+1]-=10;
				c[n1]+=1;
			}
			c[n1+1]+=tempc;
			addition(n1-1,n2);
		}
	}
	else
	{
		for(int x=0;x<max(strlen(a),strlen(b))+5;x++)
		{
			temp[x]=a[x];
			a[x]=b[x];
			b[x]=temp[x];
		}
		addition(n2,n1);
	}
}

int main()
{
	scanf("%d",&t);
	while(t--)
	{
		scanf("%s",a);
		scanf("%s",b);
		for(int x=0;x<max(strlen(a),strlen(b))+5;x++)
		{
			c[x]=0;
		}
		if(strlen(a)>80||strlen(b)>80)
		{
			printf("overflow\n");
			continue;
		}
		else
		{
			addition(strlen(a)-1,strlen(b)-1);
			//printf("%d",(int)a[1]);
			//printf("%d,%d\n",strlen(a),strlen(b));
		}
		if(c[0]>0&&max(strlen(a),strlen(b))>=80)
		{
			printf("overflow\n");
		}
		else
		{
			for(int z=0;z<max(strlen(a),strlen(b))+1;z++)
			{
				if(c[z]==0&&z==0)
				continue;
				printf("%d",c[z]);
			}
			printf("\n");
		}
	}
	return 0;
}

C++: #include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
const int DIGIT=9;

int main() {
  int n;
  char buf[81];
  int l, x[2], y, z;
  char buf_part[DIGIT+1];
  int a[2][9];
  int b[9];

  cin >> n;
  while (n--) {
    for (int i=0; i<2; i++) {
      cin >> buf;
      l = strlen(buf);
      x[i] = (l+DIGIT-1)/DIGIT;
      y = (l-1)%DIGIT+1;
      for (int j=0; j<9; j++) {
        a[i][j] = 0;
      }
      for (int j=0; j<x[i]; j++) {
        if (!j) {
          memcpy(buf_part, buf, y);
          buf_part[y] = '\0';
        }
        else {
          memcpy(buf_part, &buf[y+DIGIT*(j-1)], DIGIT);
          buf_part[DIGIT] = '\0';
        }
        a[i][x[i]-j-1] = atoi(buf_part);
      }
    }

    for (int i=0; i<9; i++) b[i] = 0;
    z = (x[0] > x[1]) ? x[0] : x[1];
    for (int i=0; i<z; i++) {
      b[i] = a[0][i] + a[1][i];
      if (b[i] >= 1000000000) {
        a[0][i+1]++;
        b[i] -= 1000000000;
      }
    }
    if (z<9 && a[0][z]) {
      b[z] = a[0][z]+a[1][z];
      ++z;
    }
    if (b[8] >= 100000000) {
      cout << "overflow" << endl;
    } else {
      cout << b[z-1];
      for (int i=z-2; i>=0; i--) {
        cout.fill('0');
        cout.width(DIGIT);
        cout << b[i];
      }
      cout << endl;
    }
  }
  return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstdint>
#include <cstring>
#include <cctype>
#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <functional>
#include <stdexcept>
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
const double PI = 3.141592653589793238462643383279502884L;
const int LARGE_INT = 1000000007;
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define tr(c, i) for(auto i = (c).begin(); i != (c).end(); i++)
#define rtr(c, i) for(auto i = (c).rbegin(); i != (c).rend(); i++)
#define repfn(i,a,cont,next) \
  for(auto i = (a); [=](){return(cont);}(); i = [=](){return(next);}())
#define repby(i,a,b,s) repfn(i,a,i<b,i+s)
#define repab(i,a,b) repby(i,a,b,1)
#define rep(i,b) repab(i,0,b)
#define pb push_back
#define sz(c) int((c).size())

typedef vector<int> bignum;
const int max_digit = 80;

bignum operator+(const bignum& lhs, const bignum& rhs)
{
  int tmp, carry = 0;
  bignum res(max_digit, 0);
  for (int i = 0; i < max_digit; i++) {
    tmp = lhs[i] + rhs[i] + carry;
    if (tmp > 9) {
      carry = 1;
      res[i] = tmp % 10;
    } else {
      carry = 0;
      res[i] = tmp;
    }
  }
  if (carry)
    throw runtime_error("overflow");
  return res;
}

ostream& operator<<(ostream& os, const bignum& rhs)
{
  bool skip = true;
  rtr(rhs, i) {
    if (*i == 0 && skip)
      continue;

    skip = false;
    os << *i;
  }
  return os;
}

istream& operator>>(istream& is, bignum& rhs)
{
  string s;
  int i = 0;
  is >> s;
  rhs.assign(max_digit, 0);
  for (auto p = s.rbegin(); p != s.rend(); p++, i++) {
    if (i >= max_digit)
      throw runtime_error("overflow");
    rhs[i] = *p - '0';
  }
  return is;
}

int main(int argc, char **argv)
{
  int n;
  bignum a, b;
  string s;
  ostringstream os(s);

  cin >> n;
  try {
    while (n--) {
      cin >> a >> b;
      os << (a + b) << endl;
    }
    cout << os.str();
  } catch (runtime_error& re) {
    cout << re.what() << endl;
  }
  return 0;
}

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

int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i)
	{
		int A[150] = {},B[150] = {},C[150] = {};
		string inA,inB;
		cin >> inA >> inB;
		for (int j = 0; j < inA.size(); ++j)
			A[inA.size()-j] = (int)(inA[j]-'0');
		for (int j = 0; j < inB.size(); ++j)
			B[inB.size()-j] = (int)(inB[j]-'0');
		int keta = 0;
		for (int j = 1; j < 150; ++j)
		{
			C[j] += A[j] + B[j];
			if(C[j] >= 10)
			{
				C[j+1] += C[j]/10;
				C[j] = C[j]%10;
			}
			if(C[j] != 0)
				keta = j;
		}
		if(keta > 80)
			cout << "overflow" << endl;
		else
		{
			bool haji = 0;
			for (int j = 149; j > 0; --j)
			{
				if(C[j] != 0)
					haji = 1;
				if(haji)
				{
					cout << C[j];
				}
			}
			cout << endl;
		}
	}
}