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 <string>
#include <cstdio>
#include <algorithm>
#include <stdexcept>

class biglong {
	static const int part_digits = 8;
	static const int max_parts = 10;
	static const int max_digits = part_digits * max_parts;
	static const unsigned long max_part_value = 100000000;
	unsigned long parts[max_parts];
public:
	biglong(unsigned long value) : parts() { parts[0] = value; }
	biglong(const biglong& rhs) {
		std::copy_n(rhs.parts, max_parts, parts);
	}
	biglong(const std::string& rhs) : parts() {
		if (rhs.size() > max_digits) {
			throw std::overflow_error("biglong overflow");
		}
		int part_count = (static_cast<int>(rhs.size()) + part_digits - 1) / part_digits;
		int pos = static_cast<int>(rhs.size());
		for (int i = 0; i < part_count; ++i) {
			pos -= part_digits;
			if (pos < 0) {
				std::cout<< "[" << i << "]\"" << rhs.substr(0, pos + part_digits) << "\"\n";
				parts[i] = std::atol(rhs.substr(0, pos + part_digits).c_str());
			} else {
				std::cout<< "[" << i << "]\"" << rhs.substr(pos, part_digits) << "\"\n";
				parts[i] = std::atol(rhs.substr(pos, part_digits).c_str());
			}
		}
	}
	biglong& operator+=(const biglong& rhs) {
		for (int i = 0; i < max_parts - 1; ++i) {
			parts[i] += rhs.parts[i];
			if (parts[i] >= max_part_value) {
				parts[i] -= max_part_value;
				++parts[i + 1];
			}
		}
		if (parts[max_parts - 1] >= max_part_value) {
			throw std::overflow_error("biglong overflow");
		}
		return *this;
	}
	std::string c_str() const {
		std::string result;
		for (int i = max_parts - 1; i >= 0; --i) {
			if (!result.empty() || parts[i] != 0) {
				char buff[12] = {};
				if (result.empty()) {
					sprintf(buff, "%lu", parts[i]);
				} else {
					sprintf(buff, "%0*lu", part_digits, parts[i]);
				}
				result += buff;
			}
		}
		if (result.empty()) {
			result = "0";
		}
		return result;
	}
};

biglong operator+(const biglong& lhs, const biglong& rhs)
{
	return biglong(lhs) += rhs;
}

std::ostream& operator<<(std::ostream& os, const biglong& value)
{
	return os << value.c_str();
}

int main()
{
	std::string input1, input2;
	while (std::cin >> input1 >> input2) {
		try {
			biglong value1(input1);
			biglong value2(input2);
			std::cout << value1 << std::endl;
			std::cout << value2 << std::endl;
			biglong sum = value1 + value2;
			std::cout << sum << std::endl;
		}
		catch (const std::overflow_error&) {
			std::cout << "overflow" << std::endl;
		}
	}
	return 0;
}

C++: n = int(raw_input())

while n:
	n -= 1
	a = long(raw_input())
	b = long(raw_input())
	c = str(a + b)

	if len(c) > 80:
		print "overflow"
	else:
		print c

C++: #include <stdio.h>
#include <string.h>
#define N 80

int main(void){
    char buf[N+1];
    int datas;
    int degits;
    int lint1[N+1], lint2[N+1], sum[N+1];
    int cry;
    
    scanf("%d", &datas);
    for (int n=0; n<datas; n++){
        // reset
        for (int i=0; i<N; i++) lint1[i]=lint2[i]=0;
        // input
        scanf("%s", buf);
        degits = strlen(buf);
        for (int i=0; i<degits; i++){
            lint1[degits-i-1]= buf[i]-'0';
        }
        scanf("%s", buf);
        degits = strlen(buf);
        for (int i=0; i<degits; i++){
            lint2[degits-i-1]= buf[i]-'0';
        }
        // calc
        cry=0;
        for (int i=0; i<N; i++){
            sum[i] = lint1[i]+lint2[i] + cry;
            cry = sum[i]>9 ? 1:0;
            if (cry) sum[i] -= 10;
        }
        // output
    /*    if (cry){
            puts("overflow");
        } else {
            bool zero=true;
            if (cry) puts("1");
            for (int i=N-1; i>=0; i--){
                if (zero && sum[i] != 0) zero=false;
                if (!zero) printf("%d", sum[i], i);
            }
            printf("\n");
        }
        */
    }
    
    return 0;
}

C++: #include <stdio.h>

#define DEGITS 80

void load(int a[]);
void print(int a[]);

int main(void){
    int a[DEGITS]; // a[0] = LSD
    int b[DEGITS];
    int n;
    int cry;
    
    scanf("%d", &n);
    for (int i=0; i<n; i++){
        // reset
        for (int i=0; i<DEGITS; i++){
            a[i]=b[i]=0;
        }
        // load
        load(a);
        load(b);
        // add ( a <- a + b )
        cry=0;
        for (int d=0; d<DEGITS; d++){
            a[d] += (b[d] + cry);
            cry = a[d]/10;
            if (a[d]>9){
                a[d]-=10;
            }
        }
        // print
        if (cry){
            printf("overflow\n");
        } else{
            print(a);
        }
    }

    return 0;
}

void load(int a[]){
    char *pt;
    char st[DEGITS+5];
    
    scanf("%s", st);
    for (pt=st; *pt!='\0'; pt++) ;
    for (int i=0; pt!=st; i++){
        a[i] = *(--pt)-'0';
    }
}

void print(int a[]){
    int d;
    
    for (d=DEGITS-1; d>0; d--){ 
        if (a[d] != 0) break;
    }
    for (; d>0; d--) printf("%d", a[d]);
    printf("%d\n", a[0]);
}