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 <vector>
using namespace std;

int main(){
	const int size = 80;
	char str1[size + 10], str2[size + 10];
	int num1[size], num2[size], res[size];
	int n, leng1, leng2, loop, kuri;
	bool output;
	
	scanf("%d", &n);
	
	for(int a = 0; a < n; a++){
		fill(str1, str1 + size + 10, 0);
		fill(str2, str2 + size + 10, 0);
		fill(num1, num1 + size, 0);
		fill(num2, num2 + size, 0);
		fill(res, res + size, 0);
		scanf("%s", str1);
		scanf("%s", str2);
		
		//char -> int
		for(leng1 = 0; (int)str1[leng1 + 1] >= 48 && (int)str1[leng1 + 1] <= 57 && leng1 + 1 < size + 10; leng1++);//length of str1
		for(leng2 = 0; (int)str2[leng2 + 1] >= 48 && (int)str2[leng2 + 1] <= 57 && leng2 + 1 < size + 10; leng2++);//length of str2
		
		loop = 1;
		while(leng1 >= 0){
			num1[size - loop] = (int)str1[leng1] - 48;
			leng1--; loop++;
		}
		loop = 1;
		while(leng2 >= 0){
			num2[size - loop] = (int)str2[leng2] - 48;
			leng2--; loop++;
		}
		kuri = 0;
		for(int i = size - 1; i >= 0; i--){
			res[i] = num1[i] + num2[i] + kuri;
			kuri = res[i] / 10;
			if(kuri > 0) res[i] -= 10;
		}
		
		if(kuri > 0) printf("overflow\n");
		else{
			output = false;
			for(int i = 0; i < size; i++){
				if(!output && res[i] == 0) continue;
				else{
					output = true;
					printf("%d", res[i]);
				}
			}
			if(!output) printf("0");
			printf("\n");
		}
	}
	return 0;
}

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

class BigNum {
public:
	BigNum() : c(0), keta(0), size(0) {};

	BigNum(int n) : c(0), keta(0), size(0) {
		size = n;
		c = new char [size];
		memset(c, 0, size);
	};

	~BigNum() {
		if (c) {
			delete [] c;
		}
	};

	int getnum(const char* buf) {
		keta = strlen(buf);
		if (buf[keta-1] == '\n') {
			keta --;
		}
		if (keta == 0) {
			return -1;
		}
		if (c) {
			delete [] c;
		}
		size = keta;
		c = new char [size];
		int k = 0;
		for (int i = keta - 1; i >= 0; i--) {
			c[k++] = buf[i] - '0';
		}
		
		return 0;
	};

	void print(void) const {
		for (int i = keta - 1; i >= 0; i --) {
			printf("%d", c[i]);
		}
		printf("\n");
	};

	static int add(BigNum& x, BigNum& y) {
		BigNum* a;
		BigNum* b;

		if (x.keta > y.keta) {
			a = &x;
			b = &y;
		} else {
			a = &y;
			b = &x;
		}

		BigNum r(a->keta + 1);

		int h;
		int m = 0;
		for (int i = 0; i < a->keta; i++) {
			if (i < b->keta) {
				h = a->c[i] + b->c[i] + m;
			} else {
				h = a->c[i] + m;
			}
			
			m = h / 10;
			r.c[i] = h % 10;
		}

		r.keta = a->keta;
	
		if (m > 0) {
			r.c[r.keta] = m;
			r.keta ++;
		}

		if (r.keta > 80) {
			return 1;
		}

		r.print();

		return 0;
	};

	char* c;
	int keta;

private:
	size_t size;
};

int
main(void)
{
	char line[100];
	int n;

	if (fgets(line, sizeof line, stdin) == NULL) {
		return 1;
	}
	if (sscanf(line, "%d", &n) != 1) {
		return 1;
	}

	for (int i = 0; i < n; i++) {
		if (fgets(line, sizeof line, stdin) == NULL) {
			return 1;
		}
		BigNum a;
		if (a.getnum(line)) {
			return 1;
		}

		if (fgets(line, sizeof line, stdin) == NULL) {
			return 1;
		}
		BigNum b;
		if (b.getnum(line)) {
			return 1;
		}

		if (BigNum::add(a, b)) {
			printf("overflow\n");
		}
	}

	return 0;
}

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

main(){
    int tcase, m; cin >> tcase;
    string s1, s2, s3;
    for ( int i = 0; i < tcase; i++ ){
	cin >> s1 >> s2; s3 = "";
	m = max(s1.size(), s2.size());
	while( s1.size() < m ) s1 = '0' + s1;
	while( s2.size() < m ) s2 = '0' + s2;
	int c = 0;
	for ( int i = m-1; i >= 0; i-- ){
	    char ch = ((s1[i]-'0')+(s2[i]-'0')+c)%10 + '0';
	    c = ((s1[i]-'0')+(s2[i]-'0')+c)/10;
	    s3 += ch;
	}
	if ( c ) s3 += c+'0';
	reverse(s3.begin(), s3.end());
	while( s3.size() > 1 && s3[0] == '0' ) s3.erase(s3.begin());
	if ( s3.size() > 80 ) cout << "overflow" << endl;
	else cout << s3 << endl;
    }
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main() {
	int n;scanf("%d",&n);
	rep(i,n){
		string s,t;cin>>s>>t;
		string ans;
		int back=0;
		for(int j=1;j<=min(s.size(),t.size());j++){
			int d=s[s.size()-j]-'0'+t[t.size()-j]-'0'+back;
			ans=(char)(d%10+'0')+ans;
			back=d/10;
		}
		string u;
		if(s.size()>t.size())u=s;
		else u=t;
		for(int j=min(s.size(),t.size())+1;j<=u.size();j++){
			int d=u[u.size()-j]-'0'+back;
			ans=(char)(d%10+'0')+ans;
			back=d/10;
		}
		if(back)ans='1'+ans;
		if(ans.size()>=80)puts("overflow");
		cout<<ans<<endl;
	}
}