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<string>
#include<algorithm>
using namespace std;
int main(){
	int cnt, m;
	cin >> cnt;
	string s1, s2, ans;
	for(int i = 0; i < cnt; i++){
		cin >> s1 >> s2;
		ans = "";
		m = max(s1.size(), s2.size());
		while( s1.size() < m ) 
			s1 = '0' + s1;
		while( s2.size() < m )
			s2 = '0' + s2;		
		int c = 0;	
		for(int i = m-1; i >= 0; i--){
			char ch = ((s1[i] - '0') + (s2[i] - '0') + c) % 10 + '0';
			c = ((s1[i] - '0') + (s2[i] - '0') + c) / 10;
			ans += ch;
		}		
		if(c) 
			ans += c + '0';
		reverse(ans.begin(), ans.end());
		while(ans.size() > 1 && ans[0] == '0') 
			ans.erase(ans.begin());		
		if(ans.size() > 80)
			cout << "overflow" << endl;
		else
			cout << ans << endl;
	}
}

C++: #include<vector>
#include<list>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  int i,j;
  int a,n,slen,tlen;
  string s,t;
  string *u;
  cin>>n;
  u=new string[n];
  for(i=0;i<n;i++){
    cin>>s>>t;
    slen=s.length();
    tlen=t.length();
    if(slen>80||tlen>80)
      u[i]="overflow";
    else{
      u[i]="00000000000000000000000000000000000000000000000000000000000000000000000000000000";
      a=0;
      for(j=0;j< (slen>tlen?slen:tlen) ;j++){
	if((j<slen?s[slen-j-1]:'0')+(j<tlen?t[tlen-j-1]:'0')+a-'0'-'0'>9){
	  u[i][79-j]=(j<slen?s[slen-j-1]:'0')+(j<tlen?t[tlen-j-1]:'0')+a-'0'-10;
	  a=1;
	}else{
	  u[i][79-j]=(j<slen?s[slen-j-1]:'0')+(j<tlen?t[tlen-j-1]:'0')+a-'0';
	  a=0;
	}  
      }
      if(j==80&&a)
	u[i]="overflow";
      else
	u[i][79-j]=a+'0';
    }
  }
  for(i=0;i<n;i++){
    if(u[i]=="overflow")
      cout<<u[i]<<endl;
    else{
      for(j=0;j<79&&u[i][j]=='0';j++);
      for(;j<80;j++)
	cout<<u[i][j];
      cout<<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--){
    int fix = 0;
    string s1, s2, tmp, res;

    cin >> s1;
    if((int)s1.size() > 80) fix++;
    cin >> s2;
    if((int)s2.size() > 80) fix++;

    vector<int> a(100,0);
    rep(i,s1.size()) a[i] = s1[(int)s1.size()-1-i] - '0';
    vector<int> b(100,0);
    rep(i,s2.size()) b[i] = s2[(int)s2.size()-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) fix++;
    if(fix) cout << "overflow" << endl;
    else cout << res << endl;
  }

  return 0;
}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <climits>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <vector>
#include <queue>
#include <string>
#include <complex>
using namespace std;

#define rep(i,n) for(int i=0; i<n; i++)
#define repa(i,s,e) for(int i=s; i<=e; i++)
#define repd(i,s,e) for(int i=s; i>=e; i--)

typedef vector<int> vi;

int n;
string s1, s2;
char n1[80], n2[80], sum[80];

int main() {
	scanf("%d", &n);
	rep(i,n) {
		memset(n1, 0, sizeof(n1));
		memset(n2, 0, sizeof(n2));
		memset(sum, 0, sizeof(sum));

		cin>>s1>>s2;
		int l1 = s1.size();
		int l2 = s2.size();
		if(max(l1,l2) > 80) {
			printf("overflow\n");
			continue;
		}

		rep(k,l1) n1[k] = s1[l1-k-1] - '0';
		rep(k,l2) n2[k] = s2[l2-k-1] - '0';

		char a = 0;
		rep(i,80) {
			char c = n1[i] + n2[i] + a;
			a = c / 10;
			sum[i] = c % 10;
		}

		if(a != 0) {
			printf("overflow\n");
			continue;
		}

		bool start = false;
		repd(i,79,0) {
			if(sum[i] != 0) start = true;
			if(!start && sum[i] == 0) continue;
			printf("%d", sum[i]);
		}
		if(!start) printf("0");
		printf("\n");
	}
}