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 <algorithm>

using namespace std;

class longint
{
// friend
	friend ostream& operator<< (ostream&, const longint&);
	friend istream& operator>> (istream&, longint&);

// variable
private:
	string m_data;

// structor

public:
	longint(const string& data = "0") :
		m_data(data)
	{

	}

// operator
public:
	longint operator+(const longint& rhs) const
	{
		string data1 = m_data;
		string data2 = rhs.m_data;
		reverse(data1.begin(), data1.end());
		reverse(data2.begin(), data2.end());

		string result;
		int carry = 0;
		for(unsigned int i = 0; i < data1.length() || i < data2.length(); i++)
		{
			int num1 = 0;
			int num2 = 0;
			if(i < data1.length())
				num1 = ctoi( data1[i] );
			if(i < data2.length())
				num2 = ctoi( data2[i] );

			int sum = num1 + num2 + carry;
			result.push_back( itoc( sum % 10) );
			carry = sum / 10;
		}

		if(carry > 0)
			result.push_back( itoc(carry) );

		reverse(result.begin(), result.end());
		return longint(result);
	}

// method
private:
	inline static int ctoi(char c)
	{
		if(c < '0' || '9' < c)
			throw exception();

		return c - '0';
	}

	inline static char itoc(int i)
	{
		if(i < 0 || 9 < i)
			throw exception();

		return '0' + i;
	}

public:
	inline unsigned int length() const
	{
		return m_data.length();
	}
};

ostream& operator<< (ostream& stream, const longint& rhs)
{
	stream << rhs.m_data;
	return stream;
}

istream& operator>> (istream& stream, longint& rhs)
{
	stream >> rhs.m_data;
	return stream;
}

int main()
{
	int n;
	cin >> n;
	while(n-- > 0)
	{
		longint a, b;
		cin >> a >> b;

		longint result = a + b;
		if(result.length() > 80)
			cout << "overflow" << endl;
		else
			cout << a + b << endl;
	}

	return 0;
}

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

using namespace std;
int stoi(string str){
	int ret;
	stringstream ss;
	ss << str;
	ss >> ret;
	return ret;
}

class OverDigit{

public:

	int num_a[9];
	int num_b[9];
	OverDigit(string str_a, string str_b);
	void ChangeDigit(string str,int num[]);
	void Add();
};

OverDigit::OverDigit(string str_a,string str_b){

	ChangeDigit(str_a, num_a); 
	ChangeDigit(str_b, num_b);	
}

void OverDigit::ChangeDigit(string str, int num[]){

	vector <int> num_str(9, 0);
	int loc = 9, k = 8;
	int str_Max, str_rest;

	str_Max = str.length() / 9;//
	str_rest = str.length() % 9;


	for (int j = str.length() - 9; str_Max > 0; j = j-9){
		num_str[k] = stoi(str.substr(j, 9));
		loc = k;
		k--;
		str_Max--;
	}
	//?????????????????????????????????????????\??????
	num_str[loc - 1] = stoi(str.substr(0, str_rest));

	for (int j = 0; j < 9; j++){
	num[j]=num_str[j];
	}
}
//80????????§????¶???????
void OverDigit::Add(){

	int num_ans[9] = {};
	int fat,overflow=0,count=0;

	for (int j = 8; j >=0; j--){
		if (num_a[j] + num_b[j]<=999999999){
			num_ans[j] = num_a[j] + num_b[j];
		}
		else if (num_a[j] + num_b[j] > 999999999 && j!=1){
			fat = (num_a[j] + num_b[j]) - 1000000000;
			num_ans[j] = fat;
			num_a[j - 1]++;		
		}
		else if (num_a[j] + num_b[j] > 999999999 && j ==1 ){
			overflow = 1;
		}
	
	}

	if (overflow == 1){
		cout << "overflow" << endl;
	}
	else {
		for (int j = 0; j < 9; j++){
			if (num_ans[j] != 0){
				count++;
				cout << num_ans[j];

			}
			else if (num_ans[j] == 0 && count >= 1){
				cout << "000000000";
			}

		}cout << endl;
	}

};


int main(){

	//vector???????????¨??????80???????¨????
	int N;
	string str_a, str_b;

	cin >> N;
	cin.ignore();

	for (int i = 0; i < N; i++){
		getline(cin, str_a);
		getline(cin, str_b);
		OverDigit OverDigit_a(str_a,str_b);//???????????§??????
		OverDigit_a.Add();
	}

	return 0;
}

C++: // class point	の練習（クラスの高度な実装）
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>


typedef long long llong;
using namespace std;
#define MAX 100010

int main() {
	string number_A;
	string number_B;
	string sum;
	int N;
	int sum_size;

	cin >> N;

	for (int i = 0; i < N; i++) {
		cin >> number_A;
		cin >> number_B;
		if (number_A.size() > 80 || number_B.size() > 80)cout << "overflow\n";
		else {
			sum_size = max(number_A.size(), number_B.size());
			sum.resize(sum_size);
			while (number_A.size() != sum_size) {
				number_A.insert(0, "0");
			}
			while (number_B.size() != sum_size) {
				number_B.insert(0, "0");
			}
			for (int j = 0; j < min(number_A.size(), number_B.size()); j++) {
				sum[j] = number_A[j]-48 + number_B[j];
			}
			for (int j = sum_size-1; j >=0; j--) {
				if (sum[j]>57) {
					sum[j] -= 10;
					if(j!=0) sum[j - 1] += 1;
					else sum.insert(0, "1");
				}
			}
			if (sum.size() > 80) cout << "overflow\n";
			else cout << sum << endl;


		}
	}

	return 0;
}