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 <stdio.h>
 
int main(void) {
    char a[81],b[81],result[81],temp[81];
    int ketaagari;
    int i,j;
    int max;
    char in;
    int overflow;
    int count,kazu;
    scanf("%d",&kazu);
    while(getchar()!='\n');
    for(count=0;count<kazu;count++) {
        for(i=0;i<81;i++) {
            a[i]=0;b[i]=0;
        }
        i=0;
        overflow=0;
    	
    	scanf(" %s ",temp);
    	
    	i=strlen(temp);
    	//puts(temp);
        if(overflow==0) {
            for(j=0;j<i;j++)a[j]=temp[i-j-1]-'0';
        }
        i=0;
    	//printf("a %s\n",a);
    	scanf(" %s ",temp);
    	i=strlen(temp);
    	

    	
    	if(overflow==0) {
            for(j=0;j<i;j++)b[j]=temp[i-j-1]-'0';
    		
    		//printf("b %s\n",b);
 
            for(i=0,ketaagari=0,max=0;i<80;i++) {
                result[i]=(a[i]+b[i]+ketaagari)%10;
                ketaagari=(a[i]+b[i]+ketaagari)/10;
                if(result[i]!=0)max=i;
            }
            if(ketaagari)overflow=1;
        }
        if(overflow==0) {
            for(i=max;i>=0;i--)printf("%d",result[i]);
            printf("\n");
        } else printf("overflow\n");
    }
    return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include<string.h>
#include <utility>
using namespace std;
using namespace std;
int main(){
	int m;
	string in,in2;
	int a[90],b[90],ans[90];
	int f;
	int a_len,b_len,m_len;
	cin>>m;
	while(m--){
		for(int i=0;i<90;i++){
			a[i]=b[i]=ans[i]=0;
		}
		cin>>in;
		cin>>in2;
		a_len=in.size();
		b_len=in2.size();
		for(int i=0;i<a_len;i++){
			a[a_len-1-i]=in[i]-'0';
		}
		for(int i=0;i<b_len;i++){
			b[b_len-1-i]=in[i]-'0';
		}
		m_len=max(a_len,b_len);
		if(m_len>80){
			cout<<"overflow"<<endl;
			continue;
		}
		f=0;
		for(int i=0;i<m_len+1;i++){
			ans[i]=(a[i]+b[i]+f)%10;
			f=(a[i]+b[i]+f)/10;
		}
		if(ans[m_len]!=0){
			if(m_len>79){
				cout<<"overflow"<<endl;
				//continue;
			}
			//cout<<ans[m_len];
		}/*
		for(int i=0;i<m_len;i++){
			cout<<ans[m_len-1-i];
		}cout<<endl;
		
		*/
	}
	return 0;
}

C++: // AOJ 0015
#include<algorithm>
#include<iostream>
#include<string>
#define rep(i,a) for( int i = 0; i != (a); ++i )

int N;
std::string a, b;

int main()
{
	std::cin >> N;
	while( N-- )
	{
		std::cin >> a >> b;
		std::reverse( a.begin(), a.end() );
		std::reverse( b.begin(), b.end() );

		int asz = a.size(), bsz = b.size(), sz = std::max( asz, bsz );

		a.resize( 80 );
		b.resize( 80 );

		std::string ans;
		int c = 0;
		rep( i, sz )
		{
			if( i >= asz )
				a[i] = '0';
			if( i >= bsz )
				b[i] = '0';

			int t = int(a[i])+b[i]+c-2*'0';
			c = 0;
			
			if( t >= 10 )
				c = 1, t %= 10;
			ans += char(t+'0');
		}

		if( c )
			ans += '1';

		if( ans.size() > 80 )
			std::cout << "overflow" << std::endl;
		else
		{
			rep( i, ans.size() )
				std::cout << ans[ans.size()-1-i];
			std::cout << std::endl;
		}
	}

	return 0;
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"


int main() {
	int N; cin >> N;
	while (N--) {

		string a, b; cin >> a >> b;
		if (a.size() >= 81 || b.size() >= 81) {
			cout << "overflow" << endl;
		}
		vector<int>v(101);
		for (int i = 0; i < a.size(); ++i) {
			v[101 - a.size() + i] = a[i] - '0';
		}
		for (int i = 0; i < b.size(); ++i) {
			v[101 - b.size() + i] += b[i] - '0';
		}
		for (int i = 100; i > 0; --i) {
			if (v[i] >= 10) {
				v[i - 1]++;
				v[i] -= 10;
			}
		}
		int num = 0;
		num = find_if(v.begin(), v.end(), [](const int a) {return a; })-v.begin();
		if (num <= 20)cout << "overflow" << endl;
		else {
			for (int i = num; i < 101; ++i) {
				cout << v[i];
			}
			cout << endl;
		}
	}
	return 0;
}