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 <iostream>
#include <vector>
#include <cstdio>
#define N 10000
using namespace std;

char s[N];
vector<int> a,b;
int n, an,bn;

void pr( vector<int> a ){
  unsigned int i=0, len;
  while( a[i]==0 ) i++;

  len = a.size()-i;
  //  cout << "length : "<< len << endl;
  if( false && len>80 ){
    cout << "overflow";
  }else{
    for( ;i<a.size();i++ )
      cout << a[i];
  }
  cout << endl;
}

int main(){
  cin >> n;
  fgets( s,N,stdin );
  for( int loop=0;loop<n;loop++ ){
    a.clear();
    fgets( s,N,stdin );
    
    for( int i=0; s[i]!='\n' ;i++ )
      a.push_back( s[i]-'0' );
    b.clear();
    fgets( s,N,stdin );
    for( int i=0;s[i]!='\n';i++ )
      b.push_back( s[i]-'0' );
    an=a.size(); bn=b.size();

    while( an>bn ){
      b.insert( b.begin(),1, 0 ); bn++;
    }
    while( an<bn ){
      a.insert( a.begin(),1, 0 ); an++;
    }
    //    pr(a);
    //    pr(b);
    a.insert( a.begin(),1,0 );
    b.insert( b.begin(),1,0 );
    for( int i=an;i>=0;i-- ){
      a[i]+=b[i];
      if( a[i]>=10 ){
	a[i]-=10; a[i-1]++;
      }
    }
    pr( a );
  }
  return 0;
}

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

#define int long long

typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}

string s,t;
string ans;
int tmp[222222];


void solve(){
    cin>>s>>t;
    ans=string();
    reverse(all(s));reverse(all(t));
    if(s.size()<t.size())s+=string(t.size()-s.size(),'0');
    if(t.size()<s.size())t+=string(s.size()-t.size(),'0');

    memset(tmp,0,sizeof(tmp));
    rep(i,s.size()){
        tmp[i]+=s[i]-'0'+t[i]-'0';
        tmp[i+1]+=tmp[i]/10;
        tmp[i]%=10;
    }

    rep(i,s.size()){
        ans+=string(1,'0'+tmp[i]);
    }
    if(tmp[s.size()])ans+=string(1,'0'+tmp[s.size()]);
    reverse(all(ans));

    if(ans.size()>80)cout<<"overflow"<<endl;
    else cout<<ans<<endl;
}

signed main(){
    int T;cin>>T;
    while(T--)solve();
}

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

void calc() {
    if (a.size() > 80 || b.size() > 80) { cout << "overflow" << endl; return; }
    if (b.size() > a.size()) swap(a, b);
    int a1, b1, size1 = a.size()-1, size2 = b.size()-1, mod = 0, sum;
    while (size1 >= 0 && size2 >= 0) {
        a1 = a[size1] - '0';
        b1 = b[size2] - '0';
        sum = a1 + b1 + mod;
        mod = (sum > 9) ? 1 : 0; sum %= 10;
        a[size1] = (char) '0' + sum;
        size1--; size2--;
    }
    while (size1 >= 0 && mod > 0) {
        a1 = a[size1] - '0';
        sum = a1 + mod;
        mod = (sum > 9) ? 1 : 0; sum %= 10;
        a[size1] = (char) '0' + sum;
        size1--;
    }
    if (mod > 0) a = "1" + a;
    if (a.size() > 80) cout << "overflow" << endl;
    else cout << a << endl;
}


int main()  {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a >> b;
        calc();
    }

}

C++: #include<iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<sstream>
#include<algorithm>
#include<map>
#include<complex>
using namespace std;


#define li			long long int
#define rep(i,to)	for(int i=0;i<((int)(to));i++)
#define repp(i,start,to)	for(int i=(int)(start);i<((int)(to));i++)
#define pb			push_back
#define sz(v)		((li)(v).size())
#define bgn(v)		((v).begin())
#define eend(v)		((v).end())
#define allof(v)	(v).begin(), (v).end()
#define dodp(v,n)		memset(v,(li)n,sizeof(v))
#define bit(n)		(1ll<<(li)(n))
#define mp(a,b)		make_pair(a,b)
#define rin	rep(i,n)
#define EPS 1e-10
#define ETOL 1e-8
#define MOD 1000000007
#define p2(a,b)		cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)		cout<<a<<"\t"<<b<<"\t"<<c<<endl


int main(){
	li m;
	cin>>m;
	rep(k,m){
		string a,b;
		cin>>a>>b;
		li sa=sz(a),sb=sz(b);
		if(sa>sb)rep(i,sa-sb)b="0"+b;
		else rep(i,sb-sa)a="0"+a;
		
		//p2(a,b);
		
		li n=sz(a);
		li co=0;
		vector<li> res;
		
		for(li i=n-1; i>=0; i--){
			li tmp=((a[i]-'0')+(b[i]-'0'))+co;
			if(tmp>9){
				co=1;
				tmp-=10;
			}
			else co=0;
			
			res.pb(tmp);
		}
		if(co>0)res.pb(1);
		
		if(sz(res)>80)puts("overflow");
		else{
			rep(i,sz(res)){
				cout<<res[sz(res)-i-1];
			}
			puts("");
		}
	}
	
	return 0;
}