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++: import java.io.*;
import java.util.*;
import java.math.*;

class Main{	
		public static void main(String args[]) throws IOException{
			ArrayList<String> inp = new ArrayList<String>();
			
			Scanner scan = new Scanner(System.in);
			String str1 = scan.next();

			BigInteger big_inp;
			String str_c;

			int n = Integer.valueOf(str1).intValue();
			
			while(scan.hasNext()){
					str1 = scan.next();
					if(str1.length() > 80){System.out.println("overflow");}
					inp.add(str1);
			}

			BigInteger big_sum;
			for(int i=0;i<inp.size()/n;i++){
				big_sum = new BigInteger("0");
				for(int j=0;j<n;j++){
					big_inp = new BigInteger(inp.get(i*n+j));
					big_sum = big_sum.add(big_inp);
				}
				str_c = big_sum.toString();
				
				if(str_c.length() > 80)System.out.println("overflow");
				else System.out.println(big_sum);
			}
	}
}

C++: #include <stdio.h>

#define N 80

// Longint <- String
int init(int a[], char s[]);
// a <- b + c
int add(int a[], int b[], int c[]);
// print Longint
void print(int a[]);

int main(void){
	int n;
	int a[N], b[N], sum[N];
	char s[101], t[101];
	
	scanf("%d", &n);
	for (int i=0; i<n; i++){
		scanf("%s", s);
		scanf("%s", t);
		if (init(a, s)==-1 || init(b, t)==-1){
			puts("overflow");
			continue;
		}
		if (add(sum, a, b)==-1){
			puts("overflow");
		} else {
			print(sum);
		}
	}
	return 0;
}

// Longint <- String
int init(int a[], char s[]){
	int len=0;
	
	for (int i=0; i<N; i++) a[i] = 0;
	for (char *p=s; *p!='\0'; p++) len++;
	if (len>=N) return -1;
	for (int i=0; s[i]!='\0'; i++){
		a[N-len+i] = s[i] - '0';
	}
	return 0;
}
// a <- b + c
int add(int a[], int b[], int c[]){
	int cry=0;
	for (int i=N-1; i>=0; i--){
		a[i] = b[i]+c[i]+cry;
		cry = a[i]/10;
		a[i] %= 10;
	}
	return cry ? -1 : 0;
}

// print Longint
void print(int a[]){
	int i;
	for (i=0; i<N && a[i]==0; i++)
	;
	if (i==N){
		puts("0");
		return;
	} else {
		for (; i<N; i++){
			printf("%d", a[i]);
		}
		puts("");
	}
}

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

using namespace std;
int main(){
	int n,l,m,c;
	char a[90],b[90],s[90];
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		for(int j=0;j<90;j++)s[j]=0;
		scanf("%s%s",a,b);
		l = strlen(a);
		m = strlen(b);
		reverse(a,a+l);
		reverse(b,b+m);
		c=0;
		for(int j=0;j<max(l,m);j++){
			int o=c;
			if(j<l)o += a[j]-'0';
			if(j<m)o += b[j]-'0';
			c = o>9;
			s[j] = o%10 + '0';
		}
		l=max(l,m);
		if(c>0)s[l++]='1';
		reverse(s,s+l);
		if(l>80)puts("overflow");
		else puts(s);
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main (void) {
    int N;
    cin >> N;
    while (N--) {
        string s1, s2;
        cin >> s1;
        cin >> s2;
        vector<int> n1, n2, res;
        for (int i = s1.size(); i--;) {
            n1.push_back((int)(s1[i] - '0'));
        }
        for (int i = s2.size(); i--;) {
            n2.push_back((int)(s2[i] - '0'));
        }
        if (n1.size() < n2.size()) {
            for (int i = n1.size(); i < n2.size(); i++) {
                n1.push_back(0);
            }
        } else if (n2.size() < n1.size()) {
            for (int i = n2.size(); i < n1.size(); i++) {
                n2.push_back(0);
            }
        }
        int s, c = 0;
        for (int i = 0; i < n1.size(); i++) {
            s = n1[i] + n2[i] + c;
            res.push_back(s % 10);
            c = s / 10;
        }
        if (c != 0) {
            res.push_back(c);
        }
        int size = res.size();
        while (size > 0 && res[size - 1] == 0) {
            size--;
        }
        if (size >= 80) {
            cout << "overflow" << endl;
        } else {
            int i = size;
            while (i--) {
                cout << res[i];
            }
            cout << endl;
        }
    }
    return 0;
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<cstdlib>
using namespace std;

int main(void){
	int n;
	cin >> n;
	for(int i=0; i<n; i++){
		string a, b;
		cin >> a >> b;
		if(a.size()>80 || b.size()>80) {cout << "overflow" << endl;}
		else{
			vector<int> x, y, z;
			for(int j=0; j<80; j++){
				x.push_back(0);
				y.push_back(0);
				z.push_back(0);
			}

			for(int j=0; j<a.size(); j++)
				x[j] = atoi( a.substr(a.size()-1-j,1).c_str() );
			for(int j=0; j<b.size(); j++)
				y[j] = atoi( b.substr(b.size()-1-j,1).c_str() );
			
			for(int j=0; j<80; j++){
				z[j] = x[j]+y[j];
			}
			for(int j=0; j<79; j++){
				if( z[j]>=10 ){
					z[j+1]++;
					z[j]-=10;
				}
			}
			if(z[79]>=10) {cout << "overflow" << endl;}
			else {
				bool zeroume = false;
				for(int j=0; j<80; j++){
					if(z[79-j]==0 && zeroume==false){}
					else{cout << z[79-j];zeroume=true;}
				}
				cout << endl;
			}
		}
	}
	return 0;
}