Go: package main

import (
        "fmt"
        "bufio"
        "os"
)

func main() {
        var n int
        var a, b string
        sc := bufio.NewScanner(os.Stdin)
        fmt.Scanf("%d", &n)
        for i := 0; i < n; i++ {
                sc.Scan()
                a = sc.Text()
                sc.Scan()
                b = sc.Text()

                if len(a) > len(b) {
                        s := add(a, b)
                        if s[len(a)] > 0 {
                                if len(a) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(a)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                } else {
                        s := add(b, a)
                        if s[len(b)] > 0 {
                                if len(b) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(b)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                }
        }
}

// expects ln > lm
func add(n string, m string) (s [100]int) {
        ln := len(n)
        lm := len(m)
        var sum [100]int

        for i := 0; i < ln; i++ {
                var s, t int
                s = int(n[ln-1-i]) - int('0')

                if lm - 1 - i >= 0 {
                        t = int(m[lm-1-i]) - int('0')
                } else {
                        t = 0
                }

                sum[i+1] = (s + t + sum[i]) / 10
                sum[i] = (s + t + sum[i]) % 10
        }

        return sum
}

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