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 <algorithm>
using namespace std;
int main(){
  string num1,num2,tmp;
  int n;

  cin >> n;

  while(n--){

    cin >> num1 >> num2;

    if(num1.size() < num2.size()){
      tmp = num2;
      num2 = num1;
      num1 = tmp;
    }

    for(int i = 0 ; i < num1.size() ; i++ )tmp[i] = num1[i];

    for(int i = num1.size() - 1 ; i >= 0 ; i-- )
      {
	num1[i] = tmp[num1.size() - 1 - i];
      }
    for(int i = 0 ; i < num2.size() ; i++ )tmp[i] = num2[i];

    for(int i = num2.size() - 1  ; i >= 0 ; i-- )
      {
	num2[i] = tmp[num2.size() - 1 - i];
      }

    for(int i = num2.size() ; i < num1.size() ; i++ )num2+='0';

    char tmp2 = '0';
    string ans;

    for(int i = 0 ; i < num1.size() ; i++ ){
      if((tmp2 - '0') + (num1[i] - '0') + (num2[i] - '0') > 9){
	ans += (((tmp2 - '0') + (num1[i] - '0') + (num2[i] - '0') - 10) + '0');
	tmp2 = '1';
      } else {
	ans += (((tmp2 - '0') + (num1[i] - '0') + (num2[i] - '0')) + '0');
	tmp2 = '0'; 
      }
    }
  
    if((tmp2 - '0') + (num1[num1.size() - 1] - '0') + (num2[num1.size() - 1] - '0') > 9)ans+='1'; 

    for(int i = ans.size() ; i >= 0 ; i-- ){
      cout << ans[i];
    }  
    cout << endl;
  }
  return 0;

}

C++: #include <iostream>
#include <string>
using namespace std;
int toNumber(char c){
	switch (c)
	{
	case '0': return 0;
	case '1': return 1;
	case '2': return 2;
	case '3': return 3;
	case '4': return 4;
	case '5': return 5;
	case '6': return 6;
	case '7': return 7;
	case '8': return 8;
	case '9': return 9;
	}
	return 0;
}
int main()
{
	int n, sa, sb, k, r, i;
	string a, b;
	char sum[81] = {};
	cin >> n;
	while (n--){
		cin >> a >> b;
		if (a.size() < b.size()) swap(a, b);
		sa = a.size();
		sb = b.size();
		k = i = 0;
		for (; i < sa; ++i){
			if (i < sb) k = toNumber(a[sa - 1 - i]) + toNumber(b[sb - 1 - i]) + k;
			else 		k = toNumber(a[sa - 1 - i]) + k;
			r = k % 10;
			k = k / 10;
			sum[i] = (char)r;
		}
		if (0 != k) sum[i] = (char)k;
		else --i;
		for (int d = i; d >= 0; --d)
			cout << (int)sum[d];
		cout << "\n";
	}
	return 0;
}

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

#define 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;
}