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


int main(){
  int n,i,j;
  
  
  int up = 0;
  cin >> n;
  for(i=0;i<n;i++){
    int sum[110]={};
    string a,b;
    up = 0;
    cin >> a >> b;
    int sa=a.size(),sb=b.size();
    int flag=0;
    if(max(sa,sb)>80) flag =1;
    else 
    for(j=0;j<max(sa,sb);j++){
      if(sa>j&&sb>j){
	sum[j] = (a[sa-j-1]-'0') + (b[sb-j-1]-'0') + up;
      }else if(sa>j){
	sum[j] = (a[sa-j-1]-'0') + up;
      }else if(sb>j){
	sum[j] = (b[sb-j-1]-'0') + up;
      }
      up=0;
      if(sum[j]>9){
	up=1;
	sum[j]-=10;
      }
    }
    sum[max(sa,sb)]=up;
    int k=max(sa,sb);
    while(sum[k]==0&&k>0) k--;
    if(k>=80||flag==1) cout << "overflow";
    else
    for(j=k;j>=0;j--)
      cout << sum[j];
    cout << endl;
  }
}

C++: #include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(){
	long int io[11],it[11],three[11];
	int n,a,b,c,xo,xt,x;
	char one[80],two[80],t[8];
	scanf("%d",&n);
	for(a=0;a<n;a++){
		scanf("%s",&one);
		scanf("%s",&two);
		xo=strlen(one)/8;
		xt=strlen(two)/8;
		if(xo<xt){x=xt;}
		else{x=xo;}
		for(b=0;b<11;b++){
			three[b]=0;
		}
		for(b=0;b<10;b++){
			for(c=0;c<8;c++){
				t[c]=one[c+b*8];
			}
			io[b]=atoi(t);
		}
		for(b=0;b<10;b++){
			for(c=0;c<8;c++){
				t[c]=two[c+b*8];
			}
			it[b]=atoi(t);
		}
		for(b=0;b<=x;b++){
			three[b]+=io[b]+it[b];
			three[b+1]+=three[b]/100000000;
			three[b]=three[b]%100000000;
		}
/*		if(three[10]==0){
			printf("%ld",three[x]);
			for(b=1;b<=x;b++){
				printf("%08ld",three[x-b]);
			}
			printf("\n");
		}
		else{printf("overflow\n");}*/
	}
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
bool checkOverFlow(string& p) {
  //80行超えているかを判定
  if(p.size() > 80) {
    return false;
  } else return true;
}

void addZero(string& p, int num) {
  //addZero(string型, 0を先頭に付け加える個数)
  for(int i=0; i<num; i++) {
    p = '0' + p;
  }
  return;
}

int main() {
  int N;//データセットの個数
  cin >> N;
  //データを配列にセット
  string* value1 = new string[N];
  string* value2 = new string[N];
  for(int i=0; i<N; i++) {
    cin >> value1[i] >> value2[i];
    //80行超えていたらoverflow
    if(value1[i].size() > 80 or value2[i].size() > 80) {
      value1[i] = "overflow";
    } else {
      //桁数を先頭に0をつけて揃える
      if(value1[i].size() > value2[i].size()) {
        addZero(value2[i], value1[i].size() - value2[i].size());
      } else {
        addZero(value1[i], value2[i].size() - value1[i].size());
      }
    }
  }
  
  ////////////////
  //足し算をする//
  ////////////////
  for(int i=0; i<N; i++) {
    if(value1[i] == "overflow") {
      cout << "overflow" << endl;
      continue;
    }
    //最大の桁数
    int length = max(value1[i].size(), value2[i].size());
    //繰り上がりの保存配列
    int* carryUp = new int[length +1];
    for(int i=0; i<length +1; i++) {
      carryUp[i] = 0;
    } 
    //答えの保存配列
    int* ans = new int[length +1];
   
    for(int j=0; j<length; j++) {
      int sum;
      sum = (value1[i][value1[i].size()-j-1] - '0')
        + (value2[i][value2[i].size()-j-1] - '0')
        + carryUp[j];
      if(sum>9) carryUp[j+1] = 1;
      ans[j] = sum % 10;

      /*
        cout << "value1:  " << value1[i][value1[i].size()-j-1] - '0' << endl;
        cout << "value2:  " << value2[i][value2[i].size()-j-1] - '0' << endl;
        cout << "carryUp: " << carryUp[j] << endl;
        cout << "ans      " << ans[j] << endl;
        cout << "===========" << endl;
      */
    }

    //出力
    int start;//桁数(1:length桁 0:length+1桁)
    if(carryUp[length] == 1){
      ans[length] = 1;
      start = 0;
    } else start = 1;

    string output = "";
    for(int i=start; i<=length; i++) {
      output += ans[length -i];
    }

    if(output.size() > 80) {
      cout << "overflow" << endl;
    } else {
      for(int i=start; i<=length; i++) {
        cout << ans[length -i];
      }
      cout << endl;
    }
    
    delete[] carryUp;
    delete[] ans;
  }
  delete[] value1;
  delete[] value2;
}

C++: #define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

#include <bits/stdc++.h>
using namespace std;


int main(){
  int n;
  cin>>n;
  
  string a,b;

  while(n--){
    cin>>a>>b;
    reverse(ALL(a));
    reverse(ALL(b));
    vector<int> c(81,0),d(81,0),e(81,0),f(81,0);
    if(a.size()>80 || b.size()>80) cout<<"overflow"<<endl;
    else{
      for(int i=0;i<(int)a.size();i++){
        c[i]=a[i]-'0';
      }
      for(int i=0;i<(int)b.size();i++){
        d[i]=b[i]-'0';
      }
      rep(i,80){
        e[i]=(c[i]+d[i]+f[i])%10;
        f[i+1]=(c[i]+d[i]+f[i])/10;
      }
      if(f[80]==1) cout<<"overflow"<<endl;
      else{
        reverse(ALL(e));
        if(e[80-max(a.size(),b.size())]!=0){
          for(int i=80-max(a.size(),b.size());i<81;i++) cout<<e[i];
        }
        else{
          for(int i=81-max(a.size(),b.size());i<81;i++) cout<<e[i];
        }
        cout<<endl;
      }
    }
  }
  
  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<sstream>
#include<string>
using namespace std;
int main(){
	int n;
	for(cin>>n;n--;){
		string a,b;
		cin>>a;
		cin>>b;
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());
		while(a.size()<b.size())a+='0';
		while(b.size()<a.size())b+='0';
		int f=0;
		for(int i=0;i<a.size();i++){
			if((a[i]-'0')+(b[i]-'0')+f>9){
				a[i]=a[i]+(b[i]-'0')+f-10;
				f=1;
			}else{
				a[i]=a[i]+(b[i]-'0');
				f=0;
			}
		}
		reverse(a.begin(),a.end());
		if(f)a="1"+a;
		if(a.size()>80){
			cout<<"overflow"<<endl;
		}else{
			for(int i=0;i<a.size();i++){
				if(a[i]!=0)
				cout<<a[i];
			}
			cout<<endl;
		}
	}
	return 0;
}