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 <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));
	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 <bits/stdc++.h>

//const static double	de_PI	= 3.14159265358979323846;
//const static int	de_MOD	= 1000000007;
//const static int	de_MAX	= 999999999;
//const static int	de_MIN = -999999999;

inline std::string Add_MultiplePrecision(const std::string A, const std::string B) {

	int a[200] = {0};
	int b[200] = {0};
	int c[300] = {0};

	for (unsigned int i = 0; i < A.length(); i++) {
		a[i] = A[A.length() - 1 - i] - '0';
	}
	for (unsigned int i = 0; i < B.length(); i++) {
		b[i] = B[B.length() - 1 - i] - '0';
	}

	int carry = 0;
	for (unsigned int i = 0; i < std::max(A.length(), B.length()); i++) {
		c[i] = (a[i] + b[i] + carry) % 10;
		c[i + 1] = carry = (a[i] + b[i] + carry) / 10;
	}

	int st = 299;
	while (c[st] == 0) {
		st--;
	}

	std::string ans;
	for (int i = st; i >= 0; i--) {
		ans += std::to_string(c[i]);
	}

	if (ans == "") {
		ans = "0";
	}

	return(ans);
}

int main(void) {

	//std::ifstream in("123.txt");	std::cin.rdbuf(in.rdbuf());

	int n = 0;
	std::cin >> n;
	std::vector<std::string> ans;

	std::string temp1, temp2, temp3;
	while (std::cin >> temp1) {
		std::cin >> temp2;
		temp3 = Add_MultiplePrecision(temp1, temp2);
		if (temp3.length() >= 80) {
			ans.push_back("overflow");
		}
		else {
			ans.push_back(temp3);
		}
	}

	for (unsigned int i = 0; i < ans.size(); i++) {
		std::cout << ans[i] << std::endl;
	}
}

C++: #include<iostream>
#include<cstring>
using namespace std;
int main(){
	int n;
	cin >>n;
	for(int i=0; i<n; i++){
		char num[2][900];
		int ans[900],up=0,t,l;
		cin >>num[0]>>num[1];
		int a = strlen(num[0]), b = strlen(num[1]), max = (b>a)? b:a, min = (b>a)? a:b;
		for(l=0; l<max; l++){
			if(l<min){t = (int)num[0][a-l-1]+(int)num[1][b-l-1]-48*2+up;}
			else if(a<b){t = (int)num[1][b-l-1]-48+up;}
			else{t = (int)num[0][a-l-1]-48+up;}
			if(t>9){t-=10;up = 1;}
			else{up = 0;}
			ans[l] = t;
		}
		if(up == 1){ans[max] = 1;l++;}
		if(l<=80)for(int m=l-1; m>=0; m--){cout <<ans[m];}
		else{cout<<"overflow";}
		cout <<endl;
	}
	return 0;
}