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 <vector>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
 
#define rep(i, n) for(int i = 0; i < n; i ++)
#define ALL(T) T.begin(), T.end()
#define mp make_pair
#define pb push_back
#define MEMSET(v, h) memset((v), h, sizeof(v))
 
using namespace std; 

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;

const int INF = 1 << 24;
 
int main(void){
    int n; cin >> n;

    while(n --){
        vi res(81);

        rep(i, 2){
            string in; cin >> in;
            if(in.size() > 80){ res[80] = 1; break; }
            rep(j, in.size() + 1){
                if(j != in.size()) res[j] += in[in.size() - j - 1] - '0';
                for(int l = 0; res[j + l] > 9; l ++) res[j + l + 1] ++, res[j + l] %= 10;
            }
        }

        if(res[80]){ cout << "overflow" << endl; continue; }

        bool ok = false;
        for(int i = 79; i >= 0; i --){
            if(!ok) if(res[i]) ok = true;
            if(ok) cout << res[i];
        }
        cout << endl;
    }
 
    return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>

using namespace std;

const size_t opsize = 81, bufsize = 102;
unsigned char op1[opsize], op2[opsize];
char buf[bufsize];

bool readOp(unsigned char * op){
    memset(op, 0, opsize);
    
    fgets(buf, bufsize, stdin);
    int l = strlen(buf);
    if(l > 81) return true;

    char *p = &buf[l-2];
    for (int j = 0; j < l-1; j++) {
        op[j] = *p - '0';
        p--;
    }
    return false;
}

void printOp(unsigned char * op){
    int mh = opsize - 1;
    while(op[mh] == 0 && mh > 0) mh--;
    for(; mh >= 0; mh--){
        putchar(op[mh] + '0');
    }
    putchar('\n');
}

bool plus(){
    for (int i = 0; i < opsize - 1; i++) {
        op1[i] += op2[i];
        if(op1[i] >= 10){
            op1[i] -= 10;
            op1[i+1] += 1;
        }
    }
    return op1[opsize - 1] != 0;
}

int main(int argc, char const* argv[])
{
    int n;
    scanf("%d ", &n);
    for (int i = 0; i < n; i++) {
        bool overflow = false;
        overflow |= readOp(op1);
        overflow |= readOp(op2);
        if(overflow){
            puts("overflow");
            continue;
        }
        overflow = plus();

        if(overflow){
            puts("overflow");
            continue;
        }
        printOp(op1);
    }
    
    return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include <utility>
using namespace std;
using namespace std;
int main(){
	
	int m;
	char in[2][100];
	char ans[100];
	int ie[2];
	int ien[2];
	bool max10;
	int Min;
	bool NMin;
	scanf("%d",&m);
	for(;m--;){
		
		for(int i=0;i<2;i++){
			scanf(" %s",&in[i]);
		}
		for(int i=0;i<2;i++){
			for(ie[i]=0;in[i][ie[i]]!='\0';ie[i]++){
				in[i][ie[i]]=in[i][ie[i]]-'0';
			}
		}
		ie[0]--;
		ie[1]--;
		Min=max(ie[0],ie[1]);
		if((Min>79)||((Min>78)&&(ie[0]==ie[1])&&((int(in[0][0])+int(in[1][0]))>9))){
			cout<<"overflow"<<endl;
		}else{	
			if(ie[0]>ie[1]){
				NMin=0;
			}else{
				NMin=1;
			}
			ien[0]=ie[0];
			ien[1]=ie[1];
			for(;min(ien[0],ien[1])+1;ien[0]--,ien[1]--){
				in[NMin][ien[NMin]]=in[0][ien[0]]+in[1][ien[1]];
				if(in[NMin][ien[NMin]+1]>9){
					in[NMin][ien[NMin]+1]-=10;
					in[NMin][ien[NMin]]  +=1;
				}
			}
			max10=0;
			
			for(;ien[NMin]>-1;ien[NMin]--){
				in[NMin][ien[NMin]]=in[NMin][ien[NMin]];
				if(in[NMin][ien[NMin]+1]>9){
					in[NMin][ien[NMin]+1]-=10;
					in[NMin][ien[NMin]]  +=1;
				}
			}
			for(int j=0;j<ie[NMin]+1;j++){
				in[NMin][j]=in[NMin][j]+'0';
			}
			
			
			if(max10) cout<<"1";
			cout<<in[NMin]<<endl;
		}
	}
	return 0;
}

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

#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
int main() {
	int n;
	cin >> n;
	while(n--) {
		char a[84], b[84];
		int x[84], y[84], s[84], max;
		cin >> a >> b;
		int i = 0, j = 0;
		for(; a[i] != '\0'; ++i) {
			x[i] = a[i] - '0';
		}
		for(; b[j] != '\0'; ++j) {
			y[j] = b[j] - '0';
		}
		if(i > 80 || j > 80) {
			cout << "overflow" << endl;
			break;
		}
		if(i > j) {
			for(int k = j - 1; k >= 0; k--) {
				y[i-j+k] = y[k];
			}
			rep(k,i-j) {
				y[k] = 0;
			}
			max = i;
		} else if(i < j) {
			for(int k = i - 1; k >= 0; k--) {
				x[j-i+k] = x[k];
			}
			rep(k,j-i) {
				x[k] = 0;
			}
			max = j;
		} else max = i;
		bool f = 0;
		for(int k = max - 1; k >= 0; k--) {
			int c = x[k] + y[k];
			if(f) c++;
			if(c >= 10) {
				f = 1, c -= 10;
			} else f = 0;
			s[k] = c;
		}
		if(f) {
			max++;
		}
		if(max > 80) cout << "overflow" << endl;
		else {
			if(f) {
				cout << 1;
				max--;
			}
			rep(k,max) {
				cout << s[k];
			}
			cout << endl;
		}
	}
	return 0;
}

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

int main(){
  int n;
  string a,b;
  cin>>n;
  for(int j=0;j<n;j++){
    cin>>a>>b;
    int asize=a.length();
    int bsize=b.length();
    int smax=max(asize,bsize);
    bool flag=false;
    int s;
    stringstream ss;
    for(int i=0;i<smax;i++){
      if(asize-i-1<0) s=strtol(b.substr(bsize-i-1,1).c_str(),NULL,0);
      else if(bsize-i-1<0) s=strtol(a.substr(asize-i-1,1).c_str(),NULL,0);
      else s=strtol(a.substr(asize-i-1,1).c_str(),NULL,0)+strtol(b.substr(bsize-i-1,1).c_str(),NULL,0);
      if(flag) s++;
      ss<<s%10;
      if(s>9)
	flag=true;
      else
	flag=false;
    }
    string ans=ss.str();
    if(ans.length()>80){
      cout<<"overflow"<<endl;
      continue;
    }
    if(flag) cout<<1;
    for(string::reverse_iterator rit=ans.rbegin();rit!=ans.rend();rit++)
    cout<<*rit;
    cout<<endl;
  }
  return 0;
}

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

#define Max 80
 
using namespace std;
 
int main(){
 
  int n, i, j;
  scanf("%d",&n);
 
  while(n--){
	  char str[100];
	  int ar[3][100], leng[3], ovf=0;

	  for(i=0; i<100; i++) ar[0][i]=ar[1][i]=ar[2][i]=0;

	  for(i=0; i<2; i++){
		scanf(" %s",str);
		leng[i]=strlen(str);
		if(Max<leng[i]) ovf=1;

			for(j=0; j<leng[i];j++)
				ar[i][j]=str[leng[i]-1-j]-'0';
	  }
	 
	for(i=0; i<100-1; i++){
		int s =(ar[2][i]+ar[0][i]+ar[1][i]);
		ar[2][i]  =s%10;
		ar[2][i+1]=s/10;
	}

	for(i=0; (i<100)&&(0==ar[2][100-1-i]); i++);
		leng[2]=100-i;

	
	if(Max<leng[2]) ovf=1;
 
  if(1==ovf)   printf("overflow\n");
  else{
	  for(i=0; i<leng[2]; i++)
		  printf("%d",ar[2][leng[2]-1-i]);
	  printf("\n");
  }
  }

    return 0;
}