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++: 
#define _USE_MATH_DEFINES
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <memory>
#include <string>

#include <algorithm>
#include <complex>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>

using namespace std;

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#define __typeof__ decltype
#endif

#define ITER(c)         __typeof__((c).begin())
#define FOREACH(it, c)  for (ITER(c) it=(c).begin(); it != (c).end(); ++it)
#define RITER(c)        __typeof__((c).rbegin())
#define RFOREACH(it, c) for (RITER(c) it=(c).rbegin(); it != (c).rend(); ++it)
#define REP(i, n)       REPEAT(i, 0, n)
#define REPEAT(i, k, n) for (int i = (k); i < (n); ++i)
#define REVREP(i, n)    for (int i = ((n)-1); i >= 0; --i)
#define ESIZEOF(A)      (sizeof(A)/sizeof((A)[0]))
#define MIN(p1,p2)      (((p1)<(p2))?(p1):(p2))
#define MAX(p1,p2)      (((p1)>(p2))?(p1):(p2))
#define CIN_NO_SYNC     do { cin.tie(0); ios_base::sync_with_stdio(false); } while(0)

bool add(char *d, int n, string &s){
    int l = s.length();
    int j = 0;
    int carry = 0;
    while(carry || j < l){
        if(j >= n) return true;
        int dgt = (j < l) ? (s[l-j-1] - '0') : 0;
        d[j] = d[j] + dgt + carry;
        carry = d[j] / 10;
        d[j] %= 10;
        j++;
    }
    return false;
}
void print(const char *d, int n){
    bool pf = false;
    for(int i = n-1; i >= 0; i--){
        if(d[i] != 0 || pf || i == 0){
            pf = true;
            printf("%c", '0' + d[i]);
        }
    }
    printf("\n");
}

int main(void){
    CIN_NO_SYNC;
    int n;
    cin >> n;
    char d[80];

    REP(i,n){
        string s1, s2;
        cin >> s1 >> s2;
        //cout << s1 << ":" << s2 << endl;
        memset(d, 0, sizeof(d));
        if(add(d, sizeof(d), s1) || add(d, sizeof(d), s2)){
            printf("overflow\n");
        } else {
            print(d, sizeof(d));
        }
    }
    return 0;
}

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

int a[81] {0};
int b[81] {0};
int sum[55][81] {0};

int main()
{
    int n;
    cin >> n;

    for (int i = 0; i < n; i++)
    {
        string s1, s2;
        cin >> s1 >> s2;
        int l1 = s1.length(), l2 = s2.length();
        for (int j = l1 - 1; j >= 0; j--)
        {
            a[l1-1-j] = int(s1[j]) - 48;
        }
        for (int j = l2-1; j >= 0; j--)
        {
            b[l2-1-j] = int(s2[j]) - 48;
        }

        int ll = max(l1, l2);
        for (int j = 0; j < ll; j++)
            sum[i][j] = a[j] + b[j];

        for (int j = 0; j < ll; j++)
        {
            sum[i][j+1] += sum[i][j] / 10;
            sum[i][j] %= 10;
        }


        for (int j = 0; j < 81; j++)
        {
            a[j] = 0;
            b[j] = 0;
        }

    }

    for (int i = 0; i < n; i++)
    {
        if (sum[i][80] > 0)
            cout << "overflow" << endl;
        else
        {
            int j = 80;
            while (sum[i][j] <= 0)
                j--;
            while (j >= 0)
            {
                cout << sum[i][j];
                j--;
            }
            cout << endl;
        }
    }

    return 0;
}

C++: #include<iostream>
#include<string>;
using namespace std;
string Sum(string str1, string str2){
	int str1_index, str2_index, num, advance;
	string strsum;
	if(str1.size() < str2.size()){
		while(str1.size() != str2.size()) str1 = "0" + str1;
	}else if(str1.size() > str2.size()){
		while(str1.size() != str2.size()) str2 = "0" + str2;
	}
	str1_index = str1.size()-1;
	str2_index = str2.size()-1;
	advance = 0;
	while(true){
		num = (str1[str1_index] - '0') + (str2[str2_index] - '0') + advance;//????????????????£?????¶???????+??°????????°
		strsum = char( (num % 10) + '0') + strsum;//??????????????\
		//cout<<"strsum="<<strsum<<endl;
		(num >= 10)? advance=1: advance=0;
		str1_index--;
		str2_index--;
		if(str1_index<0 || str2_index<0){
			if(advance>0) strsum = "1" + strsum;
			break;
		}
	}
	return strsum;
}

int main(){
	int i, n;
	string str1,str2;
	string strsum;
	while(cin>>n){
		for(i=0;i<n;i++){
			cin>>str1;
			cin>>str2;
			strsum = Sum(str1, str2);
			if(strsum.size()>80) cout<<"overflow"<<endl;
			cout<<strsum<<endl;
		}
	}
	
	return 0;
}