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 <cstring>
#include <algorithm>
#include <sstream>
using namespace std;

string error = "overflow";

int main(){
	int n;
	cin >> n;
	bool over[n];
	int keta[n];
	string a[n], b[n];
	char c[n][81];
	for(int i = 0; i < n; i++){
		for(int j = 0; j < 81; j++){
			c[i][j] = '0';
		}
	}
	for(int i = 0; i < n; i++){
		over[i] = false;
		keta[i] = 0;
		int extra = 0;
		cin >> a[i] >> b[i];
		if(a[i].size() < b[i].size()){
			swap(a[i],b[i]);
		}
		
		for(int j = 0; j < a[i].size(); j++){
			int p, q, num;
			stringstream sa, sb, sc;
			sa << a[i][a[i].size()-j-1];
			sa >> p;
			if(j < b[i].size()){
				sb << b[i][b[i].size()-j-1];
				sb >> q;
			}
			else{
				q = 0;
			}
			if(p+q+extra < 10){
				sc << p+q+extra;
				sc >> c[i][j];
				extra = 0;
			}
			else{
				int kurai;
				kurai = (p+q+extra)%10;
				sc << kurai;
				sc >> c[i][j];
				extra = 1;
				if(j == a[i].size()-1){
					c[i][a[i].size()] = '1';
					keta[i] = 1;
				}
			}
		}
		if(c[i][80] != '0'){
			over[i] = true;
		}
	}
	for(int i = 0; i < n; i++){
		if(over[i] == true){
			cout << error;
		}
		else{
			for(int j = 0; j < a[i].size()+keta[i]; j++){
			cout << c[i][a[i].size()+keta[i]-j-1];
			}
		}
		cout << endl;
	}
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){

  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    string a,b,out,tmp;
    cin >> a;
    cin >> b;
    //int m=max(a.size(),b.size());
    if(a.size()<b.size()){
      tmp=a;
      a=b;
      b=tmp;
    }
    //cout << a << endl;
    int si=-a.size()+b.size();
    for(int j=a.size()-1;j>=0;j--){
      if(j+si>=0){
	//cout << si << endl;
	a[j]+=b[j+si]-'0';
	//cout << a[j] << endl;
      }else{
	a[j]+=0;
	//cout << "!" << endl;
      }
      if(a[j]>'9'&&j!=0){
	a[j-1]++;
	a[j]-=10;
      }else if(a[j]>'9'&&j==0){
	a='1'+a;
	a[1]-=10;
	//for(int i=a.size();i>0;i--)
	//  a[i]=a[i-1];
	//a[1]-=10;
	//a[0]='1';
      }
    }
    cout << a << endl;
  }

}

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, j, n;
  int len1, len2;
  char tmp;

  scanf("%d",&n);
  rep(i,n){
    string str1, str2, res;
    cin >> str1;
    cin >> str2;

    vector<int> a(200, 0), b(200, 0);
    len1 = (int)str1.size(); len2 = (int)str2.size();
    rep(j,len1) a[j] = str1[(int)len1-1-j] - '0';
    rep(j,len2) b[j] = str2[(int)len2-1-j] - '0';

    rep(j,200){
      int sum = a[j] + b[j];
      if(sum >= 10){ sum %= 10; a[j+1]++;}
      res += (sum + '0');
    }

    reverse(res.begin(), res.end());
    int f = 0;
    rep(j,res.size()){
      if(res[j] != '0') f = 1;
      if(f && res.size()-j > 79){
        cout << "overflow" << endl;
        return 0;
      }
      if(f) cout << res[j];
    }

    cout << endl;
  }

  return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>

const int MAX_SIZE = 90;

#define toI(x) (x-'0')

using namespace std;

class Z
{
private:
  int size;
  char d[MAX_SIZE];
public:
  Z(char *s)
  {
    size = strlen(s);
    for(int i=0;i<MAX_SIZE - size;i++)
      d[i] = 0;
    for(int i=0,j=MAX_SIZE - size;j < MAX_SIZE; i++, j++)
      d[j] = s[i];
  }

  void add(Z r)
  {
    int tmp = max(this->size, r.size);
    int updigit = 0;
    for(int i=MAX_SIZE-1;i>=0;i--){
      int a = 0, b = 0;
      if(this->d[i] == 0&& r.d[i] == 0){
	if(!updigit)
	  goto end;
	this->d[i] = updigit+'0';
	updigit = 0;
	tmp++;
      }else{
	if(this->d[i])
	  a = toI(this->d[i]);
	if(r.d[i])
	  b = toI(r.d[i]);
	int n = a + b + updigit;
	updigit = n / 10;
	this->d[i] = (n % 10)+'0';
      }
    }
  end:
    this->size = tmp;
    return;
  }

  void print()
  {
    if(this->size > 80){
      puts("overflow");
      return;
    }
    for(int i=0;i<MAX_SIZE;i++)
      if(d[i] != -1)
	putchar(d[i]);
    puts("");
  }

  int sz()
  {
    return this->size;
  }
};

int main()
{
  int x;
  scanf("%d", &x);
  char s1[MAX_SIZE], s2[MAX_SIZE];  
/*  for(int i=0;i<x;i++){
    scanf("%s%s",s1, s2);
    Z z1(s1);
    Z z2(s2);
    if(z1.sz() > 80 || z2.sz() > 80){
      puts("overflow");
      continue;
    }
    z1.add(z2);
    z1.print();
  }*/
  return 0;
}