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

C++: #include<cstdio>

int main(){
	int a[82] = {};
	int b[82] = {};
	int c[82] = {};
	int n;
	int k,l,m,f;
	char t;
	int of;

	scanf("%d\n", &n);


	for(int i = 0; i < n; i++){
		of = k = l = 0;
		scanf("%c", &t);
		while(t - 10){
			k++;
			a[k] = t - '0';
			scanf("%c", &t);
			if(k == 81){
				of = 1;
				while(t - 10){
					scanf("%c", &t);
				}
			}
		}
		scanf("%c", &t); 

		while(t - 10){
			l++;
			b[l] = t - '0';
			scanf("%c", &t);
			if(l == 81){
				of = 1;
				while(t - 10){
					scanf("%c", &t);
				}
			}

		}

		m = 0;
		f = 0;

		while(k - m){
			c[m] = a[k - m];
			m++;
		}
		m = 0;
		while(l - m){
			c[m] += b[l - m ] + f;
			f = 0;
			if(c[m] > 9){
				c[m] -= 10;
				f = 1;
			}
			m++;
		}

		while(f){
			c[m] += 1;
			f = 0;
			if(c[m] > 9){
				c[m] -= 10;
				f = 1;
			}
			m++;
		}

		if(k > m){
			m = k;
		}

		for(int i = 0; i < m; i++){
			if(m == 81 || of){
				printf("overflow");
				f = 1;
				i = m;
			}else{
				if((c[m - i -1]) || f){
					printf("%d", c[m - i - 1]);
					f = 1;
				}
			}
		}
		if(f - 1){
			printf("0");
		}
		printf("\n");
	}
	return 0;
}

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[80]!=0)
        cout<<"overflow"<<endl;

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

    }

}