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<string>
//ðÇÁ·é
void addplace(unsigned int *a, unsigned int *last, int num){
	if( a == last ) return; //[·¬ÜÛÀ
	
	int carry = (*a * 10 + num) / 100000000;
	addplace(a+1, last, carry);
	*a = (*a * 10 + num) % 100000000;
}
bool trace(unsigned int *a, unsigned int *last){
	if( a == last ) return false; //[·¬ÜÛÀ
	if( !trace(a+1, last) ){
		if( *a > 0 ){
			std::cout << *a;
			return true;
		}
	}else{
		char b[11]={};
		sprintf(b,"%d",*a+100000000);
		std::cout<<b+1;
		return true;
	}
	return false;
}
void add(unsigned int *a, unsigned int *alast, unsigned int *b, int num=0){
	if( a == alast ) return; //[·¬ÜÛÀ
	
	int carry = (*a + *b + num) / 100000000;
	add(a+1, alast, b+1, carry);
	*a = (*a + *b + num) % 100000000;
}
int main(){
	int n;
	std::cin>>n;
	std::string a,b;
	std::getline(std::cin, a);//üsÇÝÌÄ
	for(;n--;){
		std::getline(std::cin, a);
		std::getline(std::cin, b);
		//uint ½è1 0000 0000-1ÜÅJEg·é
		unsigned int _a[11]={},_b[11]={};
		int pcnt = 0;
		for(std::string::iterator it=a.begin();
			it!=a.end(); it++){
			if(++pcnt>80){
				std::cout<<"overflow\n";
				goto cnti;
			}
			addplace(_a, _a+10, *it-'0');
		}
		pcnt=0;
		for(std::string::iterator it=b.begin();
			it!=b.end(); it++){
			if(++pcnt>80){
				std::cout<<"overflow\n";
				goto cnti;
			}
			addplace(_b, _b+10, *it-'0');
		}
		add(_a, _a+11, _b);
		if( _a[10] >= 1 ){
			std::cout<<"overflow\n";
		}else{
			if(!trace(_a, _a+10))
				std::cout<<'0';
			std::cout<<'\n';
		}
cnti:;
	}
}

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

string add(string a, string b) {
	int al = a.size(), bl = b.size();
	reverse(a.begin(), a.end());
	reverse(b.begin(), b.end());
	string res;
	int tmp = 0;
	for (int i = 0; i < al || i < bl || tmp; i++) {
		tmp += (i < al ? a[i] - '0' : 0) + (i < bl ? b[i] - '0' : 0);
		res.push_back('0' + tmp % 10);
		tmp /= 10;
	}
	reverse(res.begin(), res.end());
	return res;
}

int main()
{
	int N;
	string a, b;
	cin >> N;
	while (N--) {
		cin >> a >> b;
		string sum = add(a, b);
		cout << (sum.size() > 80 ? string("overflow") : sum) << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
 
#define rep(i, n) for(int i = 0; i < n; i ++)
#define ALL(T) T.begin(), T.end()
#define mp make_pair
#define pb push_back
#define MEMSET(v, h) memset((v), h, sizeof(v))
 
using namespace std; 

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;

const int INF = 1 << 24;
 
int main(void){
    int n; cin >> n;

    while(n --){
        vi res(81);

        rep(i, 2){
            string in; cin >> in;
            if(in.size() > 80){ res[80] = 1; continue; }
            rep(j, in.size() + 1){
                if(j != in.size()) res[j] += in.at(in.size() - j - 1) - '0';
                for(int l = 0; res[j + l] > 9; l ++) res[j + l + 1] ++, res[j + l] %= 10;
            }
        }

        if(res[80]){ cout << "overflow" << endl; continue; }

        bool ok = false;
        for(int i = 79; i >= 0; i --){
            if(!ok) if(res[i] || !i) ok = true;
            if(ok) cout << res[i];
        }
        cout << endl;
    }
 
    return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
    int n,k=0;
    for(cin>>n;n--;){
        string a,b;
        cin >> a;
        cin >> b;
        if(a.size < b.size()) swap(a,b);//????????????a>b?????????
        while(b.size() < a.size()) b += '0';//????????????a==b?????????
        for(int i=a.size()-1;i>=0;i--){//???????????????????????????
            a[i] += b[i] + k;
            if(a[i] > '9'){
                a[i]-=10;
                k = 1;
            }
            else k = 0;
        }
        if(k)   a+="1";//??°??????????????????????????????????¶?????????¨???
        if(a.size() > 80)   cout << "overflow" << endl;
        else    cout << a << endl;
    }
    return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
int main(){
    int n;
    scanf("%d",&n);
    for(int j=0;j<n;j++){
        string a,b;
        cin>>a>>b;
        int numa[100000]={0},numb[100000]={0};
        int flag=0;
        int sum[81]={0};
        if(80<max(a.size(),b.size())){
            puts("overflow");
            goto exit;
        }
        for(int i=a.size()-1,k=0;0<=i;i--,k++)numa[k]=a[i]-'0';
        for(int i=b.size()-1,k=0;0<=i;i--,k++)numb[k]=b[i]-'0';
        for(int i=0;i<max(a.size(),b.size());i++){
            sum[i]+=(numa[i]+numb[i]);
            sum[i+1]=sum[i]/10,sum[i]=sum[i]%10;
            if(sum[80]!=0){
                puts("overflow");
                goto exit;
            }
        }
        for(int i=80;0<=i;i--){
            if(flag==1||sum[i]!=0)flag=1;
            if(flag==1)printf("%d",sum[i]);
        }
        if(flag==0)printf("0");
        puts("");
exit:
;
    }
    return 0;
}

C++: #include<cstdio>
#include<cstring>


int main(){
	int i, j, n, na, nb, flg;
//	long a[10], b[10];
	char a[100]={'\0'}, b[100]={'\0'}, tp;

	scanf("%d", &n);
	while(n--){
	scanf("%s", a);
	na=strlen(a);
	for(i=0, j=na; i<na/2; i++, j--){
		tp=a[i]; a[i]=a[j-1]; a[j-1]=tp;
	}
	scanf("%s", b);
	nb=strlen(b);
	for(i=0, j=nb; i<nb/2; i++, j--){
		tp=b[i]; b[i]=b[j-1]; b[j-1]=tp;
	}
	if(na>80 || nb>80){ printf("overflow\n"); break;}

	if(na>nb){
 		for(i=0, flg=0; i<nb; i++){
			flg+=a[i]-'0'+b[i]-'0';
			a[i]=flg%10+'0';
			flg/=10;
	}	
		for(i=nb; i<na; i++){
			flg+=a[i]-'0';
			a[i]=flg%10+'0';
			flg/=10;
	}
		if(flg) a[i]='1';
	}
	else {
		for(i=0, flg=0; i<na; i++){
			flg+=a[i]-'0'+b[i]-'0';
			a[i]=flg%10+'0';
			flg/=10;
	}			
		for(i=na; i<nb; i++){
			flg+=b[i]-'0';
			a[i]=flg%10+'0';
			flg/=10;
	}
		if(flg) a[i]='1';
	}


	j=strlen(a);
	for(i=j; i>0; i--) printf("%c",a[i-1]);
	printf("\n");
	}
	return 0;
}