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<stdio.h>

int main(){
	char x[100], y[100], z[100];
	int n, xl, yl, zl;
	int i;

	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s",x);
		scanf("%s",y);
		for(xl=0;x[xl]!='\0';xl++) x[xl]-='0';
		for(yl=0;y[yl]!='\0';yl++) y[yl]-='0';
		if(--xl>=80 || --yl>=80){
			printf("overflow\n");
			continue;
		}

		for(zl=0;zl<100;zl++) z[zl]=0;
		for(zl=0;xl>=0 || yl>=0;zl++){
			if(xl>=0) z[zl]+=x[xl--];
			if(yl>=0) z[zl]+=y[yl--];
			if(z[zl]>=10){
				z[zl]-=10;
				z[zl+1]++;
			}
		}

		for(zl=99;z[zl]==0;zl--){}
		if(zl>=80){
			printf("overflow\n");
			continue;
		}
		for(xl=0;zl>=0;zl--) x[xl++]=(z[zl]+'0');
		x[xl] = '\0';
		printf("%s\n",x);
	}
	return 0;
}

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

int main(){

	int n;
	std::cin >> n;

	for (int i = 0; i < n; i++){
		std::string str, str2, res;
		std::cin >> str >> str2;

		std::reverse(str.begin(), str.end());
		std::reverse(str2.begin(), str2.end());

		bool up = 0;
		for (int i = 0; up || i < std::max(str.size(), str2.size()); i++){

			int a = 0, b = 0;

			if (str.size() > i)a = str[i] - '0';
			if (str2.size() > i)b = str2[i] - '0';

			if (up + a + b >= 10){
				res += (up + a + b - 10 + '0');
				up = 1;
			}
			else{
				res += (up + a + b + '0');
				up = 0;
			}
		}

		std::reverse(res.begin(), res.end());

		if (res.size() > 80)std::cout << "overflow" << std::endl;
		else std::cout << res << std::endl;
	}

	return 0;
}

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

int main() {
	int n;cin>>n;
	string a,b;for(int j=0;j<n;j++){
	cin>>a>>b;
	int d=0;
	if(a.length()<b.length())
	{
		int aa=a.length();
		for(int i=0;i<b.length()-aa;i++)a='0'+a;
	}
	else
	{
		int bb=b.length();
		for(int i=0;i<a.length()-bb;i++)b='0'+b;
	}
	string ans="";
	for(int i=a.length()-1;i>=0;i--)
	{
		int aa=a[i]-'0';
		int bb=b[i]-'0';
		ans=char((aa+bb+d)%10+'0')+ans;
		d=(aa+bb+d)/10;
	}
	if(d)ans=char(d+'0')+ans;
	while(ans[0]=='0')
	{
		ans=ans.substr(1,ans.length()-1);
	}
	if(ans.length()>=80)cout<<"overflow"<<endl;
	else cout<<ans<<endl;}
	return 0;
}

C++: 
#include <iostream>
#include <cstring>
#define N 82

using namespace std;

void shift(char a[N]){
  int ln = strlen(a)-1;
  int i;
  for( i=N-2;i>=0;i-- ){
    if( ln>=0 )
      a[i] = a[ln--]-'0';
    else
      a[i]=0;
  }
}
void pr(char a[N]){
  int i;
  cout << "pr ";
  for( i=0;i<N-1;i++ ){
    cout << (int)a[i];
  }
  cout << endl;
}

int main(){
  int n, lp;
  char a[N],b[N], s[N];
  int i,c;

  cin >> n;
  cin.getline( a,N );
  //  cout << "n="<<n<<endl;
  for( lp=0;lp<n;lp++ ){
    //    cin >> a;
    //    cin >> b;
    cin.getline( a,N );
    cin.getline( b,N );

    //    cout << a << endl;
    //    cout << b << endl;

    shift(a); shift(b);
    //     pr(a);    pr(b);

    c=0;
    for( i=N-2;i>=0;i--){
      s[i]=a[i]+b[i]+c;
      if( s[i]>9 ){
	s[i]-=10;
	c=1;
      }else
	c=0;
    }

    if( s[0]!=0 )
      cout << "overflow" << endl;
    else{
      c=0;
      for( i=0;i<N-1;i++ ){
	if( c==0 && s[i]!=0 )
	  c=1;
	if( c==1 )
	  cout << (int)s[i];
      }
      cout << endl;
    }
  }

  return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main() {
	int n;scanf("%d",&n);
	rep(i,n){
		string s,t;cin>>s>>t;
		string ans;
		int back=0;
		for(int j=1;j<=min(s.size(),t.size());j++){
			int d=s[s.size()-j]-'0'+t[t.size()-j]-'0'+back;
			ans=(char)(d%10+'0')+ans;
			back=d/10;
		}
		string u;
		if(s.size()>t.size())u=s;
		else u=t;
		for(int j=min(s.size(),t.size())+1;j<=u.size();j++){
			int d=u[u.size()-j]-'0'+back;
			ans=(char)(d%10+'0')+ans;
			back=d/10;
		}
		if(back)ans='1'+ans;
		if(ans.size()>80)puts("overflow");
		cout<<ans<<endl;
	}
}

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

int main(){
  int n;
  cin >> n;
  while(n--){
    string a,b; cin >> a >> b;
    if(a.size() > 80 || b.size() > 80){
      cout << "overflow" << endl;
      continue;
    }
    if(a.size() < b.size()) swap(a,b);
    for(int i=a.size()-1,j=b.size()-1;i>=0;i--,j--){
      if(j >= 0) a[i] += b[j]-'0';
      if(a[i] > '9'){
	a[i] -= 10;
	if(i == 0) a = "1" + a;
	else a[i-1]++;
      }
    }
    if(a.size() > 80) cout << "overflow" << endl;
    else cout << a << endl;
  }
}

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

int main(){
  int n;
  string s1,s2,ans;
  cin >> n;
  
  for(int i=0; i<n; i++){
    cin >> s1;
    cin >> s2;
    int m = max(s1.size(),s2.size());
    while(m>s1.size()) '0' + s1;
    while(m>s2.size()) '0' + s2;

    int carry = 0;
    for(int j=m-1; m>=0; m--){
      char ch = ((s1[m]-'0') + (s2[m]-'0') + carry)%10 + '0';
      carry = ((s1[m]-'0') + (s2[m]-'0') + carry)/10;
      ans.append(ch);
    }
    if(carry) ans.append(carry+'0');
    reverse(ans.begin(),ans.end());

    //頭の0を削除していく
    while(ans.size()>1 && ans[0] == '0') ans.erase(ans.begin());
    if(ans.size() > 80) cout << 'overflow' << endl;
    cout << ans << endl;
  }
  return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
using namespace std;
int main(void)
{
	int y;
	scanf("%d",&y);
	for(int z = 0;z < y;z++)
	{
		char suji1[82],suji2[82];
		char ans[82] = {0};

		for(int i = 0;i<82;i++)
		{
			suji1[i] = '0';
			suji2[i] ='0';
		}

		int overflow = 0;

		scanf("%s",suji1);
		scanf("%s",suji2);
		int suji1s = strlen(suji1);
		int suji2s = strlen(suji2);

		int anss;
		if(suji1s>suji2s)  anss = suji1s;
		else anss = suji2s;

		suji1[suji1s] = '0';
		suji2[suji2s] = '0';

		reverse(suji1,suji1+suji1s);
		reverse(suji2,suji2+suji2s);

		for(int i = 0;i < 80;i++)
		{
			ans[i] = suji1[i]+suji2[i] - '0';
			if(ans[i] >= ':')
			{
				ans[i]  = ans[i] - 10;
				suji2[i+1] = suji2[i+1]+1;
			}
		}
		
		if(ans[anss]!= '0') anss++;
		if(anss >=81) overflow = 1;
		reverse(ans,ans+anss);
		ans[anss] = 0;
		if(overflow >= 1)
		{
			printf("overflow\n");
		}
		else
		{
			printf("%s\n",ans);
		}
		
	}
	return 0;
}