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 <cstdio>
#include <cstring>
char A[81],B[81],C[84];
int main() {
	int N,Alen,Blen;
	scanf("%d",&N);
	for(int i=0;i<N;i++) {
		scanf("%s",A);
		scanf("%s",B);
		Alen=strlen(A);
		Blen=strlen(B);
		memset(C,-1,sizeof(C));
		for(int j=Alen-1,k=0;j>=0;j--,k++) {
			C[k]=A[j]-'0';
		}
		for(int j=Blen-1,k=0;j>=0;j--,k++) {
			C[k]+=B[j]-'0';
		}
		for(int j=0;C[j]!=-1;j++) {
			if(C[j]/10) {
				if(C[j+1]!=-1)C[j+1]+=C[j]/10;
				else C[j+1]=C[j]/10;
			}
			C[j]%=10;
		}
		for(int j=82;j>=0;j--) {
			if(C[j]!=-1) {
				if(j>80) {
					printf("overflow");
					break;
				}
				putchar('0'+C[j]);
			}
		}
		putchar('\n');
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
  char a[200];
  int n,k,l,i;
  cin>>n;
  while(n--){
    string s1,s2;
    cin>>s1>>s2;
    for(i=0;i<200;i++)a[i]='0';
    for(k=0,i=s2.size()-1;i>=0;i--)a[k++]=s2[i];
    for(l=0,i=s1.size()-1;i>=0;i--,l++){
      a[l]+=s1[i]-'0';
      if(a[l]>'9'){a[l+1]++;a[l]-=9;}
    }
    if(k>81||l>81)cout<<"overflow";
    else if(l<k)for(i=k-1;i>=0;i--)cout<<a[i];
    else for(i=l-1;i>=0;i--)cout<<a[i];
    cout<<endl;
  }
}

C++: #include<string>
#include<vector>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<sstream>
#include<functional>
#include<map>
#include<stack>
#include<set>
#include<cmath>

#define REP(i,s,e) for(int i=int(s);i<int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)

#define EPS 1e-6

using namespace std;

int main(){

	int n;
	cin >> n;

	rep(i,n){

	string a,b;
	cin >> a >> b;

	int sa=a.size(); int sb=b.size(); int p=max(sa,sb);
	vector<char>s;

	if(sa>80 || sb>80)
	cout << "overflow" << endl;
	else{

	string z;
	if(sa>sb){
	rep(j,sa-sb)
	z+='0';
	b=z+b;
	}
	if(sb>sa){
	rep(j,sb-sa)
	z+='0';
	a=z+a;
	}

    int c=0;
	rep(j,p){

	c+=(a[p-1-j]-'0')+(b[p-1-j]-'0');

	s.push_back(c%10+'0');
	c=c/10;

	}

    if(c==1) s.push_back(c%10+'0');

    if(s.size()>80)
    cout << "overflow" << endl;
    else
    rep(k,s.size()) cout << s[s.size()-1+k];

	}
	s.clear();

	}

	return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main () {
    int n;
    string a, b;
    
    cin >> n;
    for(int i=0;i<n;i++){
        int x[81]={0}, y[81]={0}, z[81]={0};
        
        cin >> a;
        cin >> b;
        
        reverse(a.begin(), a.end());
        reverse(b.begin(), b.end());
        
        for(int j=0;j<a.size();j++){
            x[j]=a[j]-'0';
        }
        for(int j=0;j<b.size();j++){
            y[j]=b[j]-'0';
        }
        
        for(int j=0;j<80;j++){
            z[j]+=x[j]+y[j];
            if(z[j]>=10){
                z[j+1]=1;
                z[j]-=10;
            }
        }
        
        if(z[80]>0){
            cout << "overflow" <<endl;
        }else{
            bool flag = 0;
            for(int j=79;j>=0;j--){
                if(z[j]==0 && flag==0){
                    continue;
                }else{
                    flag=1;
                }
                cout<<z[j];
            }
            if(flag==0){
                cout<<0;
            }
            cout<<endl;
            
        }
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <cmath>

using namespace std;

int main() {
	int N, c, tmp;
	cin >> N;
	string ans;
	for (int i = 0; i < N; i++) {
		ans = "";
		c = 0;
		string a, b;
		cin >> a >> b;
		for (int j = 0; j < max(a.length(), b.length()); j++) {
			int A, B;
			A = a.length() - j - 1;
			B = b.length() - j - 1;
			tmp = (A >= 0 ? a[A] - '0' : 0) + (B >= 0 ? b[B] - '0' : 0) + c;
			ans = (char)(tmp % 10 + '0') + ans;
			c = tmp / 10;
		}
		if (c) {
			ans = '1' + ans;
		}
		cout << (ans.length() > 80 ? "overflow" : ans) << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main( void )
{
	int n;
	cin >> n;
	for ( int i = 0; i < n; i++ )
	{
		string a;
		string b;
		cin >> a >> b;

		reverse( a.begin(), a.end() );
		reverse( b.begin(), b.end() );

		string::iterator it_a = a.begin();
		string::iterator it_b = b.begin();

		string kotae;
		int carry = 0;
		while ( it_a != a.end() || it_b != b.end() )
		{
			int an;
			int bn;
			if ( it_a != a.end() )
				an = ((*it_a) - '0');
			else
				an = 0;

			if ( it_b != b.end() )
				bn = ((*it_b) - '0');
			else
				bn = 0;

			int cn = an + bn + carry;
			if ( cn >= 10 )
			{
				carry = 1;
				cn %= 10;
				kotae += ('0' + cn);
			}
			else
			{
				carry = 0;
				kotae += ('0' + cn);
			}

			if ( it_a != a.end() )
				it_a++;
			if ( it_b != b.end() )
				it_b++;
		}

		if ( carry == 1 )
			kotae += '1';

		reverse( kotae.begin(), kotae.end() );

		cout << kotae << endl;

	}

	return 0;
}

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

int main() {
	ios :: sync_with_stdio(false);
	int t; cin >> t;
	while(t --) {
		int a[120];
		memset(a, 0, sizeof a);
		auto f = [&]() {
			string s; cin >> s;
			reverse(s.begin(), s.end());
			for(int i = 0; i < s.size(); i ++)
				a[i] += s[i] - '0';
		};
		f(); f();
		for(int i = 0; i + 1 < 120; i ++)
			if(a[i] >= 10) {
				a[i + 1] ++;
				a[i] -= 10;
			}
		int s = -1;
		for(int i = 0; i < 120; i ++)
			if(a[i]) s = i;
		if(s == -1)
			cout << 0 << '\n';
		else if(s >= 80)
			cout << "overflow\n";
		else {
			for(int i = s; i >= 0; i --)
				cout << a[i];
			cout << '\n';
		}
	}
	return 0;
}