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<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define FOR(i,a,b) for(int i=a;i<=b;++i)
#define LL long long
using namespace std;
static const LL INF = 1LL<<61LL;
typedef pair<int,int> PII;

string a,b;
string ans;
int M;
char t[]={'0','1','2','3','4','5','6','7','8','9'};

void add(int n,int m,int c,string s){
    int k;
    //cout<<s<<" "<<a[n-1]<<" "<<b[m-1]<<" "<<c<<endl;
    if(n-1<0&&m-1<0){
        if(c!=0)s+=t[c];
        for(int i=s.size()-1;i>=0;--i){
            ans+=s[i];
        }
        return ;
    }
    if(n-1>=0&&m-1>=0)k=a[n-1]-'0'+b[m-1]-'0'+c;
    else if(n-1>=0)k=a[n-1]-'0'+c;
    else if(m-1>=0)k=b[m-1]-'0'+c;
    if(k>=10){
        k-=10;
        c=1;
    }
    else c=0;
    add(n-1,m-1,c,s+t[k]);
}

/*bool MOD1(string num){
    bool res=false;
    LL k=num.size();
    LL mod;
    int i=-1;
    LL n=0;
    while(k){
        n=(n*10)+num[i+1]-'0';
        mod=n%M;
        n=mod;
        k--;
        i++;
    }
    if(mod==0)return true;
    return false;
}
bool MOD2(string num){
    bool res=false;
    LL k=num.size();
    LL mod;
    int i=-1;
    LL n=0;
    while(k){
        n=(n*10)+num[i+1]-'0';
        mod=n%5;
        n=mod;
        k--;
        i++;
    }
    if(mod==0)return true;
    return false;
}
bool MOD3(string num){
    bool res=false;
    LL k=num.size();
    LL mod;
    int i=-1;
    LL n=0;
    while(k){
        n=(n*10)+num[i+1]-'0';
        mod=n%7;
        n=mod;
        k--;
        i++;
    }
    if(mod==0)return true;
    return false;
}
bool MOD4(string num){
    bool res=false;
    LL k=num.size();
    LL mod;
    int i=-1;
    LL n=0;
    while(k){
        n=(n*10)+num[i+1]-'0';
        mod=n%11;
        n=mod;
        k--;
        i++;
    }
    if(mod==0)return true;
    return false;
}*/
int main(){
    int n;
    cin>>n;
    rep(i,n){
    cin>>a>>b;
    //cin>>M;
        add(a.size(),b.size(),0,"");
        //if(!MOD1(ans)&&!MOD2(ans)&&!MOD3(ans)&&!MOD4(ans))cout<<ans<<endl;
        //else cout<<"king is angry"<<endl;
        if(ans.size()<=80&&a.size()<=80&&b.size()<=80)cout<<ans<<endl;
        else cout<<"overflow"<<endl;
        ans.clear();
    }
}

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

using namespace std;

#define REP(i,a,b) for((i)=(a);(i)<(int)(b);(i)++)
#define rep(i,n) REP(i,0,n)
// BEGIN CUT HERE
#define foreach(itr,c) for(typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
// END CUT HERE

int main(){
  int i, n;
  vector<int> ans;
  int num,ai,bi, c =0;
  bool f;
  string a, b;

  cin >> n;
  while(n--){
    cin >> a >> b;
    f = false;

    rep(i,100){
      num = 0;
      ai = a.size()-i-1;
      bi = b.size()-i-1;
      if(ai < 0 && bi < 0 && c == 0 ) break;

      if(ai >= 0) num += a[ai] - '0';
      if(bi >= 0) num += b[bi] - '0';
      ans.push_back((num + c) % 10);
      if(num+c >= 10) c = 1;
      else c = 0;
    }

    if(ans.size() > 80){
      f = true;
    }
    if(f) cout << "overflow";
    else{
      for(int j = ans.size()-1; j >= 0; j--){
        printf("%d",ans[j]);
      }
    }
    printf("\n");
  }

  return 0;
}