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 <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
int main()
{
	int n;
	cin >> n;
	for(int j=0;j<n;j++)
	{
		string s1,s2;
		vector<int> ans;
		cin >> s1;
		cin >> s2;
		reverse(s1.begin(),s1.end());
		reverse(s2.begin(),s2.end());
		int k=0;
		int p=max(s1.size(),s2.size());
		int len1=s1.size(),len2=s2.size();
		s1.resize(p+2);
		s2.resize(p+2);
		for(int i=len1;i<p+2;i++)
		{
			s1[i]='0';
		}
		for(int i=len2;i<p+2;i++)
		{
			s2[i]='0';
		}
		ans.resize(p+2);
		for(int i=0;i<p+2;i++)
		{
			ans[i]=((s1[i]-'0')+(s2[i]-'0')+k)%10;
			if((s1[i]-'0')+(s2[i]-'0')+k>=10)k=1;
			else k=0;
		}
		vector<int>::iterator it=ans.end();
		it--;
		int r=0;
		while(*it==0)
		{
			ans.erase(it);
			r++;
			it--;
		}
		ans.resize(p+2-r);
		reverse(ans.begin(),ans.end());
		if(ans.size()>80)
		{
			printf("overflow\n");
			continue;
		}
		for(int i=0;i<ans.size();i++)
		{
			cout << ans[i];
		}
		cout << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
using namespace std;
string a,b;
long long int s,cop,copp,last,n;
long long int latte[1000],cafe[1000],all[1000],ans[1000];
int main(){
    int cou=0;
    cin>>n;
    for(int l=0;l<n;l++){
        cou=0;
        fill(latte,latte+1000,0);
        fill(cafe,cafe+1000,0);
        fill(all,all+1000,0);
        fill(ans,ans+1000,0);
        cin>>a>>b;
        if(a.size()>b.size()){
            s=a.size();
            cop=a.size(),copp=b.size(),last=s;
        }
        else {
            s=b.size();
            cop=a.size(),copp=b.size(),last=s;
        }
        if(s>80){
            cout<<"overflow"<<endl;
            continue;
        }
        for(int i=0;i<a.size();i++){
            cop--;
            if(a[i]=='0')latte[cop]=0;
            if(a[i]=='1')latte[cop]=1;
            if(a[i]=='2')latte[cop]=2;
            if(a[i]=='3')latte[cop]=3;
            if(a[i]=='4')latte[cop]=4;
            if(a[i]=='5')latte[cop]=5;
            if(a[i]=='6')latte[cop]=6;
            if(a[i]=='7')latte[cop]=7;
            if(a[i]=='8')latte[cop]=8;
            if(a[i]=='9')latte[cop]=9;
            }
        for(int i=0;i<b.size();i++){
            copp--;
            if(b[i]=='0')cafe[copp]=0;
            if(b[i]=='1')cafe[copp]=1;
            if(b[i]=='2')cafe[copp]=2;
            if(b[i]=='3')cafe[copp]=3;
            if(b[i]=='4')cafe[copp]=4;
            if(b[i]=='5')cafe[copp]=5;
            if(b[i]=='6')cafe[copp]=6;
            if(b[i]=='7')cafe[copp]=7;
            if(b[i]=='8')cafe[copp]=8;
            if(b[i]=='9')cafe[copp]=9;
            }
         for(int i=0;i<=s;i++){
            all[i]+=latte[i]+cafe[i];
            if(all[i]>9){
                all[i]-=10;
                all[i+1]+=1;
            }
         }
         /*for(int i=s-1;i>-1;i--){
            if(all[last]!=0)cout<<all[last];
            cout<<all[i];
            all[last]=0;
         }*/
         for(int i=s-1;i>-1;i--){
            if(all[last]!=0){
                ans[last]=all[last];
                cou++;
                all[last]=0;
            }
            ans[i]=all[i];
            cou++;
         }
         if(cou>80)cout<<"overflow";
         else for(int i=s-1;i>-1;i--){
            if(ans[last]!=0)cout<<ans[last];
            cout<<ans[i];
            ans[last]=0;
         }
         cout<<endl;
    }
}
//99999999999999999999999999999999999999999999999999999999999999999999999999999999

C++: import java.util.Scanner;
import java.math.BigInteger;

public class Main{
    public static void main(String args[]) {
	Scanner scanner = new Scanner(System.in);
	int N = scanner.nextInt();
	for (int i = 0; i < N; i++) {
	    String a = scanner.nextString(), b = scanner.nextString();
	    BigInteger sum = BigInteger(a) + BigInteger(b);
	    String n_80 = "1";
	    for (int j = 0; j < 79; j++) {
		n_80 += "0";
	    }
	    if (sum >= BigInteger(n_80)) {
		System.out.println("overflow");
	    }
	    else {
		System.out.println(sum.toString());
	    }
	}
    }
}

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

void add(char *buf1, char *buf2){
	int big1[100] = {}, big2[100] = {};
	
	int len1 = strlen(buf1);
	if(len1 > 80){
		printf("overflow\n");
		return;
	}
	int len2 = strlen(buf2);
	if(len2 > 80){
		printf("overflow\n");
		return;
	}
		
	for(int i = 0; i < len1; i++){
		big1[len1 - i - 1] = buf1[i] - 48;
	}
	for(int i = 0; i < len2; i++){
		big2[len2 - i - 1] = buf2[i] - 48;
	}
	
	int len = (len1 > len2) ? len1 : len2;
	for(int i = 0; i < len; i++){
		big1[i] += big2[i];
		if(big1[i] >= 10){
			big1[i + 1]++;
			big1[i] -= 10;
		}
	}
	
	int j = len + 1;
	for(; j >= 0; j--){
		if(big1[j] > 0){
			break;
		}
	}
	if(j >= 80){
		printf("overflow\n");
		return;
	}
	for(; j >= 0; j--){
		printf("%d", big1[j]);
	}
	printf("\n");
}

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

C++: #include<iostream>
#include<cctype>
#include<cstring>
using namespace std;
int main(){
  int o,a,sl,ss,ansl[82],anss[82];
  cin >> o;
  char n[81],n2[81],nl[82],ns[82],c[80];
  cin.getline(c,80); 
  for(int i=0;i<o;i++){
    cin.getline(n,81);
    cin.getline(n2,81);
    a = 0;
    if( strlen(n)>strlen(n2) ){
      sl = strlen(n);     
      ss = strlen(n2);
      for(int i=sl-1;i>=0;i--){
	nl[a] = n[i];
	a++;
      }
      a = 0;
      for(int i=ss-1;i>=0;i--){
	ns[a] = n2[i];
	a++;
      }
    }
    else{
      sl = strlen(n2);
      ss = strlen(n);
      for(int i=sl-1;i>=0;i--){
	nl[a] = n2[i];
	a++;
      }
      a = 0;
      for(int i=ss-1;i>=0;i--){
	ns[a] = n[i];
	a++;
      }
    }
    for(int i=0;i<sl;i++) ansl[i] = nl[i]-'0';
    for(int i=0;i<ss;i++) anss[i] = ns[i]-'0';
    for(int i=0;i<ss;i++) ansl[i] += anss[i];
    for(int i=0;i<sl;i++){
      if(ansl[i]>=10){
	ansl[i] -= 10;
	if(i+1<sl) ansl[i+1] += 1;
	else{
	  ansl[i+1] = 1;
	  sl += 1;
	}
      }
    }
    if(sl>80) cout << "overflow";
    else  for(int i=sl-1;i>=0;i--) cout << ansl[i];
    cout << endl;
  }
  return 0;
}