Go: package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	const maxCapacity = 512 * 1024
	buf := make([]byte, maxCapacity)
	scanner.Buffer(buf, maxCapacity)

	n := nextInt()
	maxint, _ := new(big.Int).SetString("100000000000000000000000000000000000000000000000000000000000000000000000000000000", 10)

	for i := 0; i < n; i++ {
		aStr := nextString()
		bStr := nextString()

		a, _ := new(big.Int).SetString(aStr, 10)
		b, _ := new(big.Int).SetString(bStr, 10)
		c := big.NewInt(0).Add(a, b)

		if c.Cmp(maxint) < 0 {
			fmt.Println(c)
		} else {
			fmt.Println("overflow")
		}
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 30;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };

int n;
string a, b;
bool can_up = false;

int main() {
	scanf( "%d", &n );
	while ( n-- ) {
		cin >> a;
		cin >> b;
		if ( a.size() > 80 || b.size() > 80 ) {
			printf( "overflow\n" );
			continue;
		}
		if ( a.size() < b.size() ) {
			swap( a, b );
		}
		while ( a.size() > b.size() ) {
			b = "0" + b;
		}
		for ( int i = a.size() - 1; i >= 0; i-- ) {
			a[ i ] += b[ i ] - '0' + can_up;
			can_up = ( a[ i ] - '0' ) / 10;
			a[ i ] = ( ( a[ i ] - '0' ) % 10 ) + '0';
		}
		if ( can_up ) {
			a = "1" + a;
			can_up = false;
		}
		if ( a.size() > 80 ) {
			printf( "overflow\n" );
			continue;
		}
		printf( "%s\n", a.c_str() );
	}
	return 0;
}

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

char s1[10000];
char s2[10000];

int n1[10000];
int n2[10000];

int no[100];
char so[100];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i = 0; i < n; i++)
	{
		scanf("%s",s1);
		scanf("%s",s2);
		int l = strlen(s1);
		for(int i = 0; i < l; i++)
		{
			n1[i] = s1[l - 1 - i] - '0';
		}
		for(int i = l; i < 80; i++)
		{
			n1[i] = 0;
		}
		l = strlen(s2);
		for(int i = 0; i < l; i++)
		{
			n2[i] = s2[l - 1 - i] - '0';
		}
		for(int i = l; i < 80; i++)
		{
			n2[i] = 0;
		}
		int keta = 0;
		for(int i = 0; i < 80; i++)
		{
			int w = n1[i] + n2[i] + keta;
			no[i] = w % 10;
			keta = w / 10;
		}
		if(keta != 0)
		{
			printf("overflow\n");
		}
		else
		{
			int b = 0;
			for(int i = 80 - 1; i >= 0; i--)
			{
				if(b != 0 || no[i] != 0)
				{
					so[b] = no[i] + '0';
					b++;
				}
			}
			if(b == 0)
			{
				printf("0\n");
			}
			else
			{
				so[b] = '\0';
				printf("%s\n",so);
			}
		}
	}
	return 0;
}

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

using namespace std;

int main (void) {
    int N;
    cin >> N;
    while (N--) {
        string s1, s2;
        cin >> s1;
        cin >> s2;
        vector<int> n1, n2, res;
        for (int i = s1.size(); i--;) {
            n1.push_back((int)(s1[i] - '0'));
        }
        for (int i = s2.size(); i--;) {
            n2.push_back((int)(s2[i] - '0'));
        }
        if (n1.size() < n2.size()) {
            for (int i = n1.size(); i < n2.size(); i++) {
                n1.push_back(0);
            }
        } else if (n2.size() < n1.size()) {
            for (int i = n2.size(); i < n1.size(); i++) {
                n2.push_back(0);
            }
        }
        int s, c = 0;
        for (int i = 0; i < n1.size(); i++) {
            s = n1[i] + n2[i] + c;
            res.push_back(s % 10);
            c = s / 10;
        }
        while (c != 0) {
            res.push_back(c % 10);
            c /= 10;
        }
        int size = res.size();
        while (size > 0 && res[size - 1] == 0) {
            size--;
        }
        if (size > 80) {
            cout << "overflow" << endl;
        } else {
            int i = size;
            while (i--) {
                cout << res[i];
            }
            cout << endl;
        }
    }
    return 0;
}

C++: //#define _USE_MATH_DEFINES
#include <iostream>
//#include <stdio.h>
//#include <iomanip>
#include <vector>
#include <string>
//#include <algorithm>
//#include <functional>
//#include <cmath>
//#include <time.h>

using namespace std;


int main(){

	int n, k1, k2, left, right, buf, flag;
	string s1, s2 , out;
	int aa1[10], aa2[10], ans[10];

	cin >> n;

	for (int i = 0; i < n; i++){
		for (int i = 0; i < 10; i++){
			aa1[i] = 0;
			aa2[i] = 0;
			ans[i] = 0;
		}
		flag = 0;

		cin >> s1 >> s2;
		k1 = s1.size();
		k2 = s2.size();

		if (k1 > 80 || k2 > 80){
			cout << "overflow" << endl;
		}
		else{
			buf = 8 - k1 % 8;
			for(int i = 0; i < buf; i++){
				s1.insert(0,"0");
			}
			buf = 8 - k2 % 8;
			for (int i = 0; i < buf; i++){
				s2.insert(0, "0");
			}
			left = s1.size()-8;
			for (int i = 0; i < 10; i++){
				aa1[i] = atoi(s1.substr(left, 8).c_str());
				left -= 8;
				if (left < 0)break;
			}
			left = s2.size() - 8;
			for (int i = 0; i < 10; i++){
				aa2[i] = atoi(s2.substr(left, 8).c_str());
				left -= 8;
				if (left < 0)break;
			}

			for (int i = 0; i < 10; i++){
				ans[i] += aa1[i] + aa2[i];
				if (ans[i] >= 100000000){
					ans[i + 1] += 1;
					ans[i] -= 100000000;
				}
			}
			if (ans[10] >= 100000000){
				cout << "overflow" << endl;
			}
			else{
				for (int i = 9; i >= 0; i--){
					if (flag == 0){
						if (ans[i] != 0){
							printf("%d",ans[i]);
							flag = 1;
						}
					}
					else{
						printf("%08d", ans[i]);
					}
				}
				cout << endl;
			}
		}

	}
	
	return 0;
}

C++: #include <iostream>
//#include <boost/multiprecision/cpp_int.hpp>

using namespace boost::multiprecision;

int main()
{
  unsigned int a;
  cpp_int b, c;
  std::cin >> a;
  for (unsigned int i = 0; i < a * 2; ++i) {
    if (i % 2 == 0) {
      std::cin >> b;
    } else {
      std::cin >> c;
      std::cout << b + c << std::endl;
    }
  }
}