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 <stdio.h>
#include <string.h>
#define N 80

int main(void){
    char buf[N*2];
    int datas;
    int degits;
    int lint1[N+1], lint2[N+1], sum[N+1];
    int cry;
    
    scanf("%d", &datas);
    for (int n=0; n<datas; n++){
        // reset
        for (int i=0; i<N; i++) lint1[i]=lint2[i]=0;
        // input
        scanf("%s", buf);
        degits = strlen(buf);
        for (int i=0; i<degits; i++){
            lint1[degits-i-1]= buf[i]-'0';
        }
        scanf("%s", buf);
        degits = strlen(buf);
        for (int i=0; i<degits; i++){
            lint2[degits-i-1]= buf[i]-'0';
        }
        // calc
        cry=0;
        for (int i=0; i<N; i++){
            sum[i] = lint1[i]+lint2[i] + cry;
            cry = sum[i]>9 ? 1:0;
            if (cry) sum[i] -= 10;
        }
        // output
        if (cry){
            puts("overflow");
        } else {
            bool zero=true;
            if (cry) puts("1");
            for (int i=N-1; i>=0; i--){
                if (zero && sum[i] != 0) zero=false;
                if (!zero) printf("%d", sum[i], i);
            }
            printf("\n");
        }
        
    }
    
    return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
  int n;
  cin >>n;
  while(n--){
    string one,two,ans;
    cin >>one>>two;
    int os = one.size()-1, ts = two.size()-1;
    int ls = (os>ts)?os:ts;
    int t = 0;
    for(int i=0; i<=ls; i++){
      if(i<=os && i<=ts){t = one[os-i]+two[ts-i]-'0'*2+t/10;}
      else if(i<=os){t = one[os-i]-'0'+t/10;}
      else if(i<=ts){t = two[ts-i]-'0'+t/10;}
      ans+=(t%10)+'0';
    }
    if(t/10){ans+='1';}
    if(ans.size()>80){cout <<"overflow"<<endl;}
    else{
      for(int i=ans.size()-1; i>=0; i--){
	cout <<ans[i];
      }
      cout <<endl;
    }
  }
  return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
typedef vector <int> vi;
typedef vector <string> vs;

string right(string &text, int n){
	int length = text.size();
	string tmp;
	tmp = text.substr(length-n, n);
	text = text.substr(0, length-n);
	return tmp;
}

long str2lng(string text){
	stringstream ss;
	ss<<text;
	long tmp;
	ss>>tmp;
	return tmp;
}

string lng2str(long n){
	stringstream ss;
	ss<<n;
	string text;
	ss>>text;
	return text;
}

string lng2str8(long n){
	stringstream ss;
	ss<<setw(10)<<setfill ('0')<<n;
	string text;
	ss>>text;
	return text;
}

vi longstr2num(string text){
	vi buf;
	while (!text.empty()){
		if (text.size()>=8)
			buf.push_back(str2lng(right(text, 8)));
		else{
			buf.push_back(str2lng(text));
			text="";
		}
	}
	return buf;
}

int main(void){
	int n;
	cin>>n;
	for (int i=0; i<n; i++){
		string s1, s2;
		cin>>s1>>s2;
		vi tmp, tmp1 = longstr2num(s1), tmp2 = longstr2num(s2);
		int size1 = tmp1.size(), size2 = tmp2.size(), size=max(size1, size2);
		long s, c = 0;
		for (int j=0; j<size; j++){
			s = c;
			if (j<size1) s += tmp1[j];
			if (j<size2) s += tmp2[j];
			
			tmp.push_back(s%100000000);
			c = s / 100000000;
		}
		if (c != 0)	tmp.push_back(c);

		stringstream buf;
		for (int j=tmp.size()-1; j>=0; j--)
			if (j != tmp.size()-1)
				buf<<setfill('0')<<setw(8)<<tmp[j];
			else
				buf<<tmp[j];
		string str;
		buf>>str;
		if (str.size()>80) cout<<"overflow"<<endl;
		else cout<<str<<endl;
	}
	return 0;
}

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

int main(){
int n,ans[100],kuri,i,j,ap,bp;
char a[1000],b[1000];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%s%s",a,b);
if(strlen(a)>80||strlen(b)>80){
printf("overflow\n");
continue;
}
ap=strlen(a)-1;
bp=strlen(b)-1;
j=0;
kuri=0;
while(ap>=0||bp>=0){
ans[j]=kuri;
if(ap>=0)ans[j]+=a[ap];
if(bp>=0)ans[j]+=b[bp];
kuri=ans[j]/10;
ans[j]%10;
j++;
ap--;
bp--;
}
if(kuri==1)ans[j]==1;
else j--;
if(j>=80){
printf("overflow\n");
continue;
}
for(;j>=0;j--){
printf("%d",ans[j]);
}
printf("\n");
}
return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>
   
using namespace std;
   
int main(){
       
    int n;
    cin>>n;
       
    while(n-- > 0){
        vector<int> ans;
        vector<int> a;
        vector<int> b;
           
        string c,d;
        cin>>c>>d;
           
        for(int i = 0; i < (int)c.size(); ++i){
            a.push_back(c[c.size()-1-i]-'0');
        }
        for(int i = 0; i < (int)d.size(); ++i){
            b.push_back(d[d.size()-1-i]-'0');
        }
           
           
        int kuri = 0;
        while(!a.empty() || !b.empty() || kuri!=0){
            int sum = kuri;
            kuri = 0;
               
            if(!a.empty()){
                sum += a[0];
                a.erase(a.begin());
            }
               
            if(!b.empty()){
                sum += b[0];
                b.erase(b.begin());
            }
               
            ans.push_back(sum%10);
            kuri += sum/10;
        }
           
        if(ans.size()>80)puts("overflow");
        else{
            for(int i = 0; i < (int)ans.size(); ++i){
                printf("%d",ans[ans.size()-1-i]);
            }puts("");
        }
    }
       
}

C++: gets;15.times{puts((a=gets.to_i+gets.to_i)>=10**80?"overfllow":a)}

C++: #include<iostream>
#include<string.h>
#define rep(i,n) for(i = 0;i < n;i++)
#define MAX(a,b) (a>b?a:b)
using namespace std;

int N;
char stra[100000],strb[100000],*ans[10000];
int sum[10000][81];

int main(){
	int i,j;
	int a[80],b[80];
	cin >> N;
	rep(i,N){
		int la,lb;
		cin >> stra;
		cin >> strb;
		la = strlen(stra);
		lb = strlen(strb);
		if(la > 80 || lb > 80){
			ans[i] = "overflow";
			continue;
		}
		rep(j,80){
			a[j] = 0;b[j] = 0;
		}
		//小さい桁をインデックスの小さいほうに入れたい。
		for(j = la-1;j >= 0;j--)
			a[j] = stra[la-1-j]-48;
		for(j = lb-1;j >= 0;j--)
			b[j] = strb[lb-1-j]-48;
		//小さい桁から計算
		rep(j,MAX(la,lb)){
			sum[i][j] += a[j]+b[j];
			sum[i][j+1] += (sum[i][j])/10;
			sum[i][j] %= 10;
		}
		if(sum[i][80] > 0){
			ans[i] = "overflow";
			continue;
		}
		ans[i] = "j";
	}
	rep(i,N){
		if(*ans[i] == 'o'){
			cout << ans[i] << endl;
			continue;
		}
		for(j = 79;sum[i][j] == 0 && j>0;j--);
		for(;j>=0;j--)
			cout << sum[i][j];
		cout << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include<string.h>
#include <utility>
using namespace std;
int main(){
int m;
string in1,in2;
int a[1000],b[1000],ans[1000];
int f;
int alen,blen,mlen;
cin>>m;
while(m--){
for(int i=0;i<90;i++){
a[i]=b[i]=ans[i]=0;
}
in1="";
in2="";
cin>>in1;
cin>>in2;
alen=in1.size();
blen=in2.size();
mlen=max(alen,blen);
if(mlen>80){
cout<<"overflow"<<endl;
continue;
}
for(int i=0;i<alen;i++){
a[alen-1-i]=in1[i]-'0';
}
for(int i=0;i<blen;i++){
b[blen-1-i]=in2[i]-'0';
}
f=0;
for(int i=0;i<mlen+1;i++){
ans[i]=(a[i]+b[i]+f)%10;
f=(a[i]+b[i]+f)/10;
}
if(ans[mlen]!=0){
if(mlen>79){
cout<<"overflow"<<endl;
continue;
}
cout<<ans[mlen];
}
for(int i=0;i<mlen;i++){
cout<<ans[mlen-1-i];
}cout<<endl;
}
return 0;
}