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<queue>
#include<string>
#include<stack>
#include<cstdio>
#include<algorithm>

using namespace std;

int main(void)
{
  int n=0;
  string as;
  string bs;
  int a[100]={};
  int b[100]={};
  int c[100]={};
  int i=0;
  int alen=0;
  int blen=0;
  int clen=0;
  int k=0;
  int j=0;

  cin>>n;

  for(j=0;j<n;j++)
    {
      for(i=0;i<100;i++)
        a[i]=b[i]=c[i]=0;
      alen=0;
      blen=0;
      clen=0;
      k=0;

      cin>>as;
      cin>>bs;

      alen=as.size();
      blen=bs.size();

      for(i=0;i<alen;i++)
        {
          a[i]=as[alen-i-1];
          //printf("a[%d]=%d\n", i, a[i]);                                      
          switch(a[i])
            {
            case '0' : a[i]=0; break;
            case '1' : a[i]=1; break;
            case '2' : a[i]=2; break;
            case '3' : a[i]=3; break;
            case '4' : a[i]=4; break;
            case '5' : a[i]=5; break;
            case '6' : a[i]=6; break;
            case '7' : a[i]=7; break;
            case '8' : a[i]=8; break;
            case '9' : a[i]=9; break;
            }
        }

      for(i=0;i<blen;i++)
        {
          b[i]=bs[blen-i-1];
          //printf("b[%d]=%d\n", i, b[i]);                                      
          switch(b[i])
            {
            case '0' : b[i]=0; break;
            case '1' : b[i]=1; break;
            case '2' : b[i]=2; break;
            case '3' : b[i]=3; break;
            case '4' : b[i]=4; break;
            case '5' : b[i]=5; break;
            case '6' : b[i]=6; break;
            case '7' : b[i]=7; break;
            case '8' : b[i]=8; break;
            case '9' : b[i]=9; break;
            }
        }

      clen=(alen > blen)? alen : blen;

      for(i=0;i<clen;i++)
        {
          c[i]+=a[i]+b[i];
          c[i+1]=c[i]/10;
          if(c[clen]!=0)
            k=1;
          c[i]=c[i]%10;
        }

      if(clen>80 || c[81]!=0)
        cout<<"overflow"<<endl;

      for(i=clen+k-1;i>=0;i--)
        cout<<c[i];
      puts("");

    }

}

C++: #include <iterator>
#include <typeinfo>
#include <list>
#include <map>     
#include <numeric>
#include <utility>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <iostream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define rep(a,t) for(int a=0;a<t;++a) 
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
#define pb push_back
#define int_maxvalue numeric_limits<int>::max()
ll mod = 1e9 + 7;
string Addition(string a,string b) {
	string ans = "";
	int bef = 0;
	int be1 = 0;
	for (int i = a.length() - 1; i >= 0; i--) {
		int added = stoi(a.substr(i, 1)) + stoi(b.substr(i, 1))+be1;

		if (added >= 10) {
			bef = 1;
			added -= 10;
		}
		else {
			bef = 0;
		}

		ans = to_string(added)+ans;
		/*
		stringstream ss;
		ss << added;

		ans = ss.str() + ans;*/
		if (i == 0) 
		{
			break;
		}
		be1 = bef;
	}
	if (be1 == 1) {
		ans = "1" + ans;
	}
	return ans;
}
int main() {
	int n;
	cin >> n;
	rep(o1, n) {
		string a, b;
		cin >> a >> b;
		if (a.length() < b.length()) {
			swap(a, b);
		}
		string b1 = b;
		for (int i = 0; i < a.length() - b1.length(); ++i) {
			b = '0' + b;
		}
		string ans = Addition(a, b);
		if (ans.length() > 80) { cout << "overflow" << endl; }
		else {
			cout << ans << endl;
		}
	}
	return 0;
}

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;

  cin >> n;
  while(n--){
    string s1, s2, tmp, res;
    cin >> s1 >> s2;

    int s1len = s1.size(), s2len = s2.size();
    if(s1len > 80 || s2len > 80){
      cout << "overflow" << endl;
      break;
    }

    vector<int> a(100,0);
    rep(i,s1.size()) a[i] = s1[s1len-1-i] - '0';
    vector<int> b(100,0);
    rep(i,s2.size()) b[i] = s2[s2len-1-i] - '0';

    rep(i,100){
      int sum = a[i] + b[i];
      if(sum >= 10){ sum %= 10; a[i+1]++;}
      tmp += sum + '0';
    }

    reverse(tmp.begin(), tmp.end());
    bool f = false;
    rep(i,tmp.size()){
      if(tmp[i] != '0') f = true;
      if(f) res += tmp[i];
    }

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

  return 0;
}