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<math.h>
using namespace std;
int main() {
	int N,a,b,c,d,f;
	int e = 0;
	int g = 0;
	string s,t,u;
	cin >> N;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < 2; j++) {
			if (j == 0) {
				cin >> s;
			}
			else if (j == 1) {
				cin >> t;
			}
		}
		a = s.size();
		b = t.size();
		if (a < b) {
			c = a;
			g = b - a;
		}
		else if (a > b) {
			c = b;
			g = a - b;
		}
		else if (a == b) {
			c = a;
			g = 0;
		}
		for (int k = c - 1; k >= 0; k--) {
			d = s[k] + t[k];
				u[c - k - 1] = d;
		}
		while (g == b - a) {
			for (int i3 = c; i3 < b; i3++) {
				u[i3] = t[i3];
			}
			break;
		}
		while (g == a - b) {
			for (int i4 = c; i4 < a; i4++) {
				u[i4] = s[i4];
			}
			break;
		}
		f = u.size();
		for (int i5 = 0; i5 < f-1; i5++) {
			if (u[i5] > 10) {
				u[i5+1] += 1;
				u[i5] -= 10;
			}
		}
		while (u[f - 1] > 10) {
			u[f] = 0;
			break;
		}
		f = u.size();
		while (f > 80) {
			cout << "overflow" << endl;
			break;
		}
		while (f <= 80) {
			for (int i2 = 0; i2 < f; i2++) {
				cout<< u[f - 1 - i2];
			}
			break;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <deque>
#include <cctype>
using namespace std;

class BigInt {
    static const int base = 10;
    public:
    deque<int> digits;
    BigInt() {
    }
    BigInt operator +(BigInt x) {
        BigInt c;

        // add
        auto di = digits.begin(), xi = x.digits.begin(), end = digits.end();
        for (; di != end && xi != x.digits.end(); di++, xi++)
            c.digits.push_back(*di + *xi);

        // set rest
        if (di == digits.end()) {
            di = xi;
            end = x.digits.end();
        }


        for (; di != end; di++)
            c.digits.push_back(*di);

        // nomalize
        int carry = 0;
        for (int i = 0; i < c.size(); i++) {
            c.digits[i] += carry;
            carry = c.digits[i] / base;
            c.digits[i] %= base;
        }
        if (carry)
            c.digits.push_back(carry);

        return c;
    }
    int size() {
        return digits.size();
    }
    istream &read(istream &is) {
        digits.clear();
        cin.ignore();

        int s;
        while (s = cin.get(), isdigit(s))
            digits.push_front(s - '0');
        is.putback(s);

        return is;
    }
    ostream &write(ostream &os) {
        for (auto di = digits.rbegin(); di != digits.rend(); di++)
            cout << *di;
        return os;
    }
};

istream &operator>>(istream &is, BigInt &b) { return b.read(is); }
ostream &operator<<(ostream &os, BigInt &b) { return b.write(os); }

int main()
{
    for (int n; cin >> n;)
        for (BigInt a, b, c; n-- && cin >> a >> b;) {
            c = a + b;
            if (c.size() <= 80)
                cout << c << endl;
            else
                cout << "overflow" << endl;
        }

    return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cstring>
#include <functional>

using namespace std;

#define REP(i,a,b) for((i)=(a);(i)<(int)(b);(i)++)
#define rep(i,n) REP(i,0,n)
// BEGIN CUT HERE
#define foreach(c,itr) for(typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
// END CUT HERE

int main(){
  int i, j, n;

  cin >> n;
  rep(i,n){
    string str1, str2, res;
    cin >> str1;
    cin >> str2;

    vector<int> a(80, 0);
    rep(j,str1.length()) a[j] = str1[str1.length()-1-j] - '0';

    vector<int> b(80, 0);
    rep(j,str2.length()) b[j] = str2[str2.length()-1-j] - '0';

    rep(j,80){
      int sum = a[j] + b[j];
      if(sum >= 10){ sum %= 10; a[j+1]++;}
      res += sum + '0';
    }

    reverse(res.begin(), res.end());
    bool f = false;
    rep(j,res.length()){
      if(res[j] != '0') f = true;
      if(f) printf("%c", res[j]);
    }
  }

  return 0;
}

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

int main(void){

	int N,math1,math2,kuri,keta;
	int i,j,k,q;
	char fi[10000],se[10000],ans[10000];

	scanf("%d",&N);

	for(i=0;i<N;i++){

		scanf("%s",&fi);
		scanf("%s",&se);

		if(strlen(fi)<=80&&strlen(se)<=80){
		for(j=strlen(fi)-1,k=strlen(se)-1,keta=0,kuri=0;j>=0||k>=0;j--,k--,keta++){
			if(j<0) math1=0;
			else math1=fi[j]-'0';
			if(k<0) math2=0;
			else math2=se[k]-'0';
            ans[keta]=((math1+math2+kuri)%10)+'0';
			kuri=(math1+math2+kuri)/10;
		}
		q=0;
		if(kuri==1) printf("1");q=1;
		if(keta+q<=80){
			for(j=keta-1;j>=0;j--){
				printf("%c",ans[j]);
			}
		}
		else printf("overflow");
		}
		else printf("overflow");
		printf("\n");
	}

	return 0;
}