Go: package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	const maxCapacity = 512 * 1024
	buf := make([]byte, maxCapacity)
	scanner.Buffer(buf, maxCapacity)

	n := nextInt()
	maxint, _ := new(big.Int).SetString("100000000000000000000000000000000000000000000000000000000000000000000000000000000", 10)

	for i := 0; i < n; i++ {
		aStr := nextString()
		bStr := nextString()

		a, _ := new(big.Int).SetString(aStr, 10)
		b, _ := new(big.Int).SetString(bStr, 10)
		c := big.NewInt(0).Add(a, b)

		if c.Cmp(maxint) < 0 {
			fmt.Println(c)
		} else {
			fmt.Println("overflow")
		}
	}
}

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;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
const int INF=10000;
char a[1001],b[1001],c[1001];
void rev(int pnt,char *cp){
    for(int i=0;i<pnt/2;i++){
        char work;
        work=*(cp+i);
        *(cp+i)=*(cp+pnt-i-1);
        *(cp+pnt-i-1)=work;
    }
}
int main(){
    int n;
    cin>>n;
    while(n--){
        for(int i=0;i<1000;i++)a[i]=b[i]=c[i]=0;
        cin>>a>>b;

        int apnt,bpnt;
        for(int i=0;i<1000;i++)if(a[i]==0){apnt=i;break;}
        for(int i=0;i<1000;i++)if(b[i]==0){bpnt=i;break;}

        if(apnt>80 || bpnt>80){cout<<"overflow"<<endl;continue;}

        rev(apnt,a);
        rev(bpnt,b);
        int d[100];
        for(int i=0;i<100;i++)d[i]=0;
        int big=max(apnt,bpnt);
        for(int i=0;i<big;i++){
            if(i<apnt)d[i]+=a[i]-'0';
            if(i<bpnt)d[i]+=b[i]-'0';
        }
        for(int i=0;i<big;i++){
            if(d[i]>=10){
                d[i]%=10;
                d[i+1]++;
            }
        }
        if(d[big]==1)big++;
        if(big>80)continue;

        for(int i=0;i<big;i++){
            c[i]=d[i]+'0';
        }
        rev(big,c);
        cout<<c<<endl;
    }
    return 0;
}