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 <string>
#include <iostream>
#include <algorithm>
using namespace std;
#define ALL(v) v.begin(), v.end()

string calc(string a, string b);

int main()
{
	int n;
	string a,b;
	scanf("%d", &n);
	
	while(n--){
		cin >> a >> b;
		cout << calc(a,b) << endl;
	}
	return(0);
}

string calc(string a, string b)
{
	reverse(ALL(a));
	reverse(ALL(b));
	
	while(a.size() < b.size()) a += '0';
	while(b.size() < a.size()) b += '0';
	
	int c = 0;
	string res;
	
	for(int i = 0; i < a.size(); i++){
		c = c+a[i] - '0' + b[i] - '0';
		res += c%10 + '0';
		c /= 10;
	}
	if(c)res += c + '0';
	if(res.size() > 80) return "overflow";
	reverse(ALL(res));
	return res;
}

C++: #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

int c[100];

void add(char*a, char*b)  //鮟倩ョ、a豈巴髟ソ
{
    fill(c,c+100,0);      //蜥檎噪蜷?ス咲スョ髮カ
    int la=strlen(a), lb=strlen(b);
    int i,j;
    for( i=la,j=lb;i>la-lb&&j>0;i--,j--) // 菫晉蕗c豈泌刈謨ー譛?柄荳イ螟壻ク?ス?    {
            c[i]+=a[i-1]-'0'+b[j-1]-'0';
            if(c[i]>9)
            {
                c[i]-=10;
                c[i-1]++;
            }
    }
        for( i=la-lb;i>0;i--)
        {
            c[i]+=a[i-1]-'0';
            if(c[i]>9)
            {
                c[i]-=10;
                c[i-1]++;
            }
        }
        
        if(la==80&&c[0]==1) printf("overflow\n");
        else
        {
            if(c[0]==0)
            {
                for( i=1;i<=la;i++)
                    printf("%d",c[i]);
                printf("\n");
            }
            else
            {
                for( i=0;i<=la;i++)
                   printf("%d",c[i]);
                printf("\n");
            }
        }
}

int main()
{
    char a[100], b[100];
    int n;
    scanf("%d",&n);

    while(n--){
    scanf("%s%s",a,b);
    int la = strlen(a), lb = strlen(b);
    if(la>80 || lb>80)
        printf("overflow\n");
    else if(la>lb)
        add(a,b);
    else add(b,a);
    }
    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

string sumString(string a, string b) {
  if (a.size() > b.size()) swap(a, b);
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  for (int i = 0; i < a.size(); i++) {
    if (a[i] + b[i] - 2 * '0' < 10) {
      b[i] += a[i] - '0';
    } else {
      b[i] = (a[i] + b[i] - 2 * '0') % 10 + '0';
      int j = i + 1;
      while (j < b.size() && b[j] == '9') {
        b[j++] = '0';
      }
      if (j == b.size()) b += "1";
      else b[j] += 1;
    }
  }
  reverse(b.begin(), b.end());
  return b;
}

int main(void) {
  int n;
  cin >> n;

  for (int i = 0; i < n; i++) {
    string a, b;
    cin >> a >> b;

    string ans = sumString(a, b);
    cout << (ans.size() <= 80 ? ans : "overflow") << endl;
  }

  return 0;
}

C++: #include<iostream>
#include<string>
typedef unsigned int u;
using namespace std;
typedef string::iterator s;
u z=100000000;
void p(u*a,u*l,u n){
	if(a-l)
	p(a+1,l,(n+=*a*10)/z),
	*a=n%z;	
}
u t(u*a,u*l){
	u r=0;
	char b[11]={};
	if(a-l)
	if(!t(a+1,l)){
		if(*a)cout<<*a,r=1;
	}else
		sprintf(b,"%d",*a+z),
		cout<<b+1,
		r=1;
	return r;
}
void d(u*a,u*l,u*b,u n=0){
	if(a-l)
	d(a+1,l,b+1,(n+=(*a+*b))/z),
	*a=n%z;
}
u main(){
	u n;
	cin>>n;
	string a,b;
	getline(cin,a);
	for(;n--;){
		getline(cin,a);
		getline(cin,b);
		u x[11]={},y[11]={},c=0;
		for(s i=a.begin();i!=a.end();p(x,x+10,*i++-48))
			if(++c>80)goto g;
		c=0;
		for(s i=b.begin();i!=b.end();p(y,y+10,*i++-48))
			if(++c>80)goto g;
		d(x,x+11,y);
		if(x[10])goto g;
		else if(!t(x,x+10))cout<<'0';
		if(0)
g:
		cout<<"overflow";
		cout<<'\n';
	}
}

C++: #include<algorithm>
#include<iostream>
#include<stdio.h>
#include<string.h>

char a[256], b[256], c[256];	
int sz = 0;
int carry = 0;

int main()
{

	memset( a, '0', 80 );
	memset( b, '0', 80 );
	std::cin >> a >> b;
	
	int maxlen = std::max( strlen( a ), strlen( b ) );
	
	if( maxlen > 80 ){
	 	goto OVERFLOW;
	}
	
	std::reverse( a, a + strlen( a ) );
	std::reverse( b, b + strlen( b ) );
	
	a[strlen( a )] = '0';
	b[strlen( b )] = '0';
	
	for( int i = 0; i <= maxlen + 1; i++ ){
		int na = a[i] - '0' + carry;
		int nb = b[i] - '0';
		
		if( na + nb >= 10 ){
			na += nb - 10;
			carry = 1;
		}
		else{
			na += nb;
			carry = 0;
		}
		
		c[i] = na + '0';
	}
	
	sz = maxlen;
	
	if( c[sz] >= '1' && c[sz] <= '9' ){
	 	sz++;
	}
	
	if( sz >= 80 ){
OVERFLOW:
	 	std::cout << "overflow" << std::endl;
	}
	else{
		std::reverse( c, c + sz );
		c[sz] = '\0';
		std::cout << c << std::endl;
	}

 	return 0;
}