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>
#include <stdlib.h>
#include <string.h>

int sum(char a[],char b[],int as,int bs,char c[]){
	int cs = (as>bs) ? as + 1 : bs + 1;
	int size = cs;
	while(as >=0 && bs >=0){
		c[cs] += a[as] + b[bs];
		if(c[cs]>9){
			c[cs] -= 10;
			c[cs-1] += 1;
		}
		as--;bs--;cs--;
	}
	while(as >=0){
		c[cs] += a[as];
		if(c[cs]>9){
			c[cs] -= 10;
			c[cs-1] += 1;
		}
		as--;cs--;
	}
	while(bs >=0){
		c[cs] += b[bs--];
		if(c[cs]>9){
			c[cs] -= 10;
			c[cs-1] += 1;
		}
		cs--;
	}
	return (c[0]>0) ? size + 1 : size;
}

int main(){
	char a[256],b[256],c[256];
	bool flag = true;
	int len1,len2,len3,n;
	scanf("%d",&n);
	while(n--){
		scanf("%s",a);
		scanf("%s",b);
		len1 = strlen(a);
		len2 = strlen(b);
		if(len1 > 80 || len2 >80){
			printf("overflow\n");
			continue;
		}
		for(int i=0;i<len1;i++) a[i] -= 0x30;
		for(int i=0;i<len2;i++) b[i] -= 0x30;
		for(int i=0;i<256;i++)  c[i] = 0;
		len3 = sum(a,b,len1-1,len2-1,c);
		if(len3>80){
			printf("overflow\n");
			continue;
		}
		if(c[0]>0) for(int i=0;i<len3;i++) printf("%d",c[i]);
		else for(int i=1;i<=len3;i++) printf("%d",c[i]);
		printf("\n");
	}
	return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <complex>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <stdio.h>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<double> VEC;
typedef vector<VEC> MAT;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define MT(a,b,c) MP(a, MP(b, c))
#define T1 first
#define T2 second.first
#define T3 second.second.first
#define T4 second.second.second

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define EPS 1.0e-9

inline int getnum(string s, int idx){
	if(idx >= s.size())return 0;
	else return s[idx]-'0';
}

string add(string s, string t){
	reverse(ALL(s));
	reverse(ALL(t));
	int n=max(s.length(), t.length());
	string r;
	int ku=0;
	REP(i,n){
		int tmp = getnum(s,i)+getnum(t,i)+ku;
		r.PB(tmp%10+'0');
		ku=tmp/10;
	}
	if(ku)r.PB('0'+ku);
	reverse(ALL(r));
	while(r[0]=='0')r.erase(0,1);
	if(r.size()>80)return "overflow";
	return r;
}

int main(){
	int t;
	cin >> t;
	REP(i,t){
		string s1,s2;
		cin>>s1>>s2;
		cout << add(s1,s2) << endl;
	}
	return 0;
}

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

using namespace std;

int main()
{
    int num;

    cin >> num;
    for (int i = 0; i < num; i++) {
        string s1, s2;

        cin >> s1 >> s2;
        if (s1.size() > 80 || s2.size() > 80)
            cout << "overflow" << endl;
        else {
            int i1 = s1.size();
            int i2 = s2.size();
            string ans;
            int tmp = 0;
            int up = 0;

            for ( ; (i1 > 0) && (i2 > 0); i1--, i2-- ) {
                tmp = (s1[i1 - 1] + s2[i2 - 1]) - 2 * '0' + up;
                up = tmp / 10;
                tmp %= 10;
                ans = char(tmp + '0') + ans;
            }
            
            if (i1 > 0) {
                for ( ; i1 > 0; i1--) {
                    tmp = s1[i1 - 1] - '0' + up;
                    up = tmp / 10;
                    tmp %= 10;
                    ans = char(tmp + '0') + ans;
                }
            }
            else if (i2 > 0) {
                for ( ; i2 > 0; i2--) {
                    tmp = s2[i2 - 1] - '0' + up;
                    up = tmp / 10;
                    tmp %= 10;
                    ans = char(tmp + '0') + ans;
                }
            }

            if (up > 0)
                ans = char(up + '0') + ans;
            cout << ans << endl;
        }
    }

    return 0;
}