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
//------------------------------------------
#include <bits/stdc++.h>

using namespace std;

////typedef
////------------------------------------------
//typedef vector<int> vi;
//typedef vector<vi> vii;
//typedef vector<string> vs;
//typedef vector<bool> vb;
//typedef vector<vb> vbb;
//typedef pair<int, int> pii;
//typedef long long ll;
//typedef unsigned long long ull;
//
////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 iter(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
//
////repetition
////------------------------------------------
//#define loop(i,a,b) for(int i=(a);i<(b);++i)
//#define rep(i,n)  loop(i,0,n)
//
////constant
////--------------------------------------------
//const double eps = 1e-10;
//const double pi  = acos(-1.0);
//const double inf = (int)1e8;
//
//// output vector
//// ------------------------------------------
//namespace std {
//    template<typename T> ostream & operator<<(ostream& os, vector<T> const& v){
//        for(auto it=v.begin(); it!=v.end(); ++it){
//            os << *it << (it+1==v.end() ? "" : ",");
//        }
//        return os;
//    }
//}
//
////clear memory
//#define clr(a) memset((a), 0 ,sizeof(a))

string IntToString(int number) {
    stringstream ss;
    ss << number;
    return ss.str();
}

int main(){
    int n;
    cin >> n;
    for(int p=0; p < n; p++){
        string ans;
        string s, t;
        cin >> s >> t;
        if(s.size() > t.size()) swap(s, t);


        int q = t.size()-s.size();
        for(int i=0; i < q; i++) s = "0" + s;

        int up = 0;
        for(int i=s.size()-1; 0 <= i; i--){
            int d = atoi(s.substr(i, 1).c_str());
            int f = atoi(t.substr(i, 1).c_str());
            ans = IntToString((d+f+up)%10) + ans;

            if(0 <= d+f+up-10) up = 1;
            else up = 0;
        }
        if(up == 1) ans = IntToString(1) + ans;

        if(80 < ans.size()) cout << "overflow" << endl;
        else cout << ans << endl;
     }
}

C++: #include<cstdio>
#include<algorithm>
#include<string.h>
#include<string>

using namespace std;

#define MAX(x,y) ((x>y)? x:y)


int n;//データセットの数

char str[2][85];//	入力される整数文字列
int n_str[2];//長さを収納

char answer[85];

FILE *fp=stdin;

int main()
{
	fscanf(fp,"%d",&n);
	for(int i=0;i<n;i++)
	{
		fscanf(fp,"%s%s",&str[0],&str[1]);
		for(int j=0;j<2;j++)n_str[j]=strlen(str[j]);
		int max =0,min=1;
		if(n_str[1]>n_str[0])
		{
			max=1;
			min=0;
		}
		int s = n_str[max]-n_str[min];
		char cha[85];
		fill(cha,cha+80,'0');
		for(int j=n_str[min];j>=0;j--)
		{
			cha[j+s]=str[min][j];
		}
		strcpy(str[min],cha);
		fill(answer,answer+80,0);
		for(int j=n_str[max]-1;j>=0;j--)
		{
			answer[j]=str[0][j]+str[1][j]-'0';
			if(answer[j]>'9')//繰り上がり時の処理
			{
				answer[j]-=10;
				if(j==0)
				{
					printf("1");
				}
				else str[0][j-1]++;
			}
		}
		printf("%s\n",answer);
	}
	fclose(fp);
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
 
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
 
typedef long long ll;
typedef pair<int, int> ii;
 
int main(){

	int n;
	cin >> n;
	while(n--){
		string s1, s2;
		cin >> s1 >> s2;
		
		int carry = 0;
		
		//int mini = min(s1.size(), s2.size());
		int maxi = max(s1.size(), s2.size());
		string ans = "";
		
		REP(i, 0, maxi){
			int sum = carry;
			if(i < s1.size()) sum += (int)(s1[s1.size() - 1 - i] - '0');
			if(i < s2.size()) sum += (int)(s2[s2.size() - 1 - i] - '0');
			ans += ('0' + sum % 10);
			carry = sum / 10;
		}
		if(carry != 0) ans += ('0' + carry);
		reverse(ans.begin(), ans.end());
		if(ans.size() <= 80) cout << ans << endl;
		else cout << "overflow" << endl;
	}
	
	return 0;
}