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<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<sstream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cctype>
#include<climits>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
#define P pair<int, int>
const int INF = INT_MAX / 2;
const int N = 80;

vector<int> makeDx(string str){
    reverse(str.begin(), str.end());
    vector<int> ret(N, 0);
    REP(i, str.size()) ret[i] = str[i] - '0';
    return ret;
}

int main(){
    int n; cin >>n;
    REP(z, n){
        string str[2]; cin >>str[0] >>str[1];
        vector<int> dx[2] = {makeDx(str[0]), makeDx(str[1])};
        vector<int> ans(N, 0);
        bool okflg = true;
        REP(i, N){
            int sum = dx[0][i] + dx[1][i];
            ans[i] += sum;
            if(i == N - 1 && ans[i] >= 10){
                cout <<"overflow" <<endl;
                okflg = false;
            }else if(ans[i] >= 10){
                ans[i + 1] = ans[i] / 10;
                ans[i] %= 10;
            }
        }
        if(okflg){
            reverse(ans.begin(), ans.end());
            int s = 0;
            while(ans[s] == 0) s++;
            FOR(i, s, N) cout <<ans[i];
            cout <<endl;
        }
    }
    return 0;
}

C++: #include <iostream>

int lastIndex(char*);
void charAdd(char*, char*,char*, const int&, const int&);
void outputNumber(char*);

int main(){
	int datasetNumber;
	std::cin >> datasetNumber;
	for (int i = 0; i < datasetNumber; ++i){
		char number1[101];
		char number2[101];
		char sumNumber[102];

		for (int j = 0; j < 101; j++){
			sumNumber[j] = '0';
		}

		std::cin >> number1 >> number2;

		int lastIndex1 = lastIndex(number1);
		int lastIndex2 = lastIndex(number2);

		charAdd(number1, number2, sumNumber, lastIndex1, lastIndex2);
		outputNumber(sumNumber);
	}
}

int lastIndex(char* charNumber){
	int index;
	for (index = 0; charNumber[index + 1] != '\0'; ++index);
	return index;
}

void charAdd(char* number1, char* number2,char* sumNumber,
	const int& lastIndex1, const int& lastIndex2){

	int index1, index2;
	if (lastIndex1 > lastIndex2){
		index1 = lastIndex1;
		index2 = lastIndex2;
	}
	else{
		index1 = lastIndex1;
		index2 = lastIndex2;
	}

	sumNumber[101] = '\0';
	for (int i = lastIndex1, sumIndex = 100;
		i >= 0; --i, --sumIndex){

		sumNumber[sumIndex] += number1[i] - '0';
	}
	for (int j = lastIndex2, sumIndex = 100;
		j >= 0; --j, --sumIndex){

		sumNumber[sumIndex] += number2[j] - '0';
		for (int index = sumIndex; sumNumber[index] > '9'; --index){
			sumNumber[index] -= 10;
			sumNumber[index - 1] += 1;
		}
	}
}

void outputNumber(char* sumNumber){
	int i;
	for (i = 0; sumNumber[i] == '0'; ++i);
	
	if (i <= 20){
		std::cout << "overflow" << std::endl;
	}
	else if (sumNumber[i] == '\0'){
		std::cout << 0 << std::endl;
	}
	else{
		for (int j = i; sumNumber[j] != '\0'; ++j){
			std::cout << sumNumber[j];
		}
		std::cout << std::endl;
	}
}

C++: #include <iterator>
#include <typeinfo>
#include <list>
#include <map>     
#include <numeric>
#include <utility>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <iostream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define rep(a,t) for(int a=0;a<t;++a) 
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
#define pb push_back
#define int_maxvalue numeric_limits<int>::max()
ll mod = 1e9 + 7;
string Addition(string a,string b) {
	string ans = "";
	int bef = 0;
	int be1 = 0;
	for (int i = a.length() - 1; i >= 0; i--) {
		int added = stoi(a.substr(i, 1)) + stoi(b.substr(i, 1))+be1;

		if (added >= 10) {
			bef = 1;
			added -= 10;
		}
		else {
			bef = 0;
		}

		ans = to_string(added)+ans;
		/*/
		stringstream ss;
		ss << added;

		ans = ss.str() + ans;*/
		be1 = bef;
		if (i == 0)
		{
			break;
		}
	}
	if (be1 == 1) {
		ans = "1" + ans;
	}
	return ans;
}
int main() {
	int n;
	cin >> n;
	rep(o1, n) {
		string a, b;
		cin >> a >> b;
		if (a.length() < b.length()) {
			swap(a, b);
		}
		string b1 = b;
		for (int i = 0; i < a.length() - b1.length(); ++i) {
			b = '0' + b;
		}
		string ans = Addition(a, b);
		if (ans.length() > 80) { cout << "overflow" << endl; }
		else {
			cout << ans << endl;
		}
	}
	return 0;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <math.h>
#include <stack>

using namespace std;

int main(){
    
    char d;
    char e;
    using namespace std;
    stack<int> st1;
    stack<int> st2;
    stack<int> st3;
    int n=0;
    //scanf("%d",&n);
    while((d=getchar())!='\n'){
        n=n*10+atof(&d);
    }
    
    for(int i=0; i<n; i++){
        
        while((d=getchar())!='\n'){
            //printf("a%c\n",d);
            st1.push(atof(&d));
        }
        
        //while(getchar()!='\n'){}
        
        while((e=getchar())!='\n'){
            //printf("b%c\n",e);
            st2.push(atof(&e));
        }
        int temp=0;
        int num=0;
        
        while(st1.empty() != true || st2.empty() != true){
            if(st1.empty()==true && st2.empty()!=true){
                temp+=st2.top();
                st2.pop();
            }else if(st1.empty()!=true && st2.empty()==true){
                temp+=st1.top();
                st1.pop();
            }else{
                temp+=st1.top()+st2.top();
                st1.pop();
                st2.pop();
            }
            st3.push(temp%10);
            temp=temp/10;
            num++;
        }
        if(temp!=0){
            st3.push(temp);
        }
        if(st3.size()>80){
            printf("overflow");
        }else{
            while(st3.empty()!=true){
                cout << st3.top();
                st3.pop();
            }
        }
        printf("\n");
        
        
        
    }
    
}

C++: #include <bits/stdc++.h>
using namespace std;

class bigint {
	deque<uint8_t> val;

public:
	bigint( const string& s ) {
		for( auto c: s ) {
			val.push_front( c - '0' );
		}
	}

	void add( const bigint& b ) {
		int x = 0;
		int i = 0;

		for( ; i < b.val.size(); ++i ) {
			if( i >= val.size() ) {
				val.push_back( 0 );
			}

			x += val[i] + b.val[i];
			val[i] = x % 10;
			x /= 10;
		}

		for( ; x > 0; ++i ) {
			if( i >= val.size() ) {
				val.push_back( 0 );
			}

			x += val[i];
			val[i] = x % 10;
			x /= 10;
		}
	}

	int length() const {
		return (int)val.size();
	}

	void print() const {
		for( int i = (int)val.size()-1; i >= 0; --i ) {
			cout << (int)val[i];
		}

		cout << '\n';
	}
};

int main() {
	ios_base::sync_with_stdio( false );

	int N;
	cin >> N;

	for( int i = 0; i<N; ++i ) {
		string a, b;
		cin >> a >> b;

		bigint x( a );
		x.add( b );

		if( x.length() <= 80 ) {
			x.print();
		}
		else {
			cout << "overflow" << '\n';
		}
	}
}