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<stdio.h>
#include <algorithm>
#include<string.h>
#include <utility>
using namespace std;
using namespace std;
int main(){
	
	int m;
	char in[2][100];
	char ans[100];
	int ie[2];
	int ien[2];
	bool max10;
	int Min;
	bool NMin;
	scanf("%d",&m);
	for(;m--;){
		
		for(int i=0;i<2;i++){
			scanf(" %s",&in[i]);
		}
		ie[0]=strlen(in[0])-1;
		ie[1]=strlen(in[1])-1;
		Min=max(ie[0],ie[1]);
		if((Min>79)||((Min>78)&&(ie[0]==ie[1])&&((int(in[0][0])+int(in[1][0]))>9))){
			cout<<"overflow"<<endl;
		}else{	
			if(ie[0]>ie[1]){
				NMin=0;
			}else{
				NMin=1;
			}
			ien[0]=ie[0];
			ien[1]=ie[1];
			for(;ien[!NMin]+1;ien[0]--,ien[1]--){
				in[NMin][ien[NMin]]=in[0][ien[0]]+in[1][ien[1]]-'0';
				if(in[NMin][ien[NMin]]>9+'0'){
					in[NMin][ien[NMin]]-=10;
					in[NMin][ien[NMin]-1]  +=1;
				}
			}
			max10=0;
			for(;ien[NMin]>-1;ien[NMin]--){
				if(in[NMin][ien[NMin]]>9+'0'){
					in[NMin][ien[NMin]]-=10;
					in[NMin][ien[NMin]-1]+=1;
					max10=1;
				}else{
					max10=0;
				}
			}
			if(max10) cout<<"1";
			cout<<in[NMin]<<endl;
		}
	}
	return 0;
}

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

#define debug(x) cout<<#x<<": "<<x<<endl
#define rep(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a);i<=(b);i++)
#define all(a) (a).begin(),(a).end()
using namespace std;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef long long ll;

void solve() {
	int n;
	cin >> n;
	rep(i, n) {
		vector<ll> v1(11), v2(11);
		string s1, s2;
		cin >> s1 >> s2;
		rep(j, 10) {
			if (s1.size() > 10 * j) v1[j] = stoi(s1.substr(10 * j, (s1.size() - 10 * j >= 10 ? 10 : s1.size() - 10 * j)));
			if (s2.size() > 10 * j) v2[j] = stoi(s2.substr(10 * j, (s2.size() - 10 * j >= 10 ? 10 : s2.size() - 10 * j)));
		}
		rep(j, 11) {
			v1[j] += v2[j];
			if (v1[j] >= 1e10) {
				v1[j] -= 1e10;
				v2[j]++;
			}
		}
		if (v1[8] || v1[9] || v1[10]) cout << "overflow" << endl;
		else {
			rep(j, 11) if (v1[10 - j] != 0) cout << v1[10 - j];
			cout << endl;
		}
	}

}




int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);


	solve();
	//system("PAUSE");
	return 0;
}

C++: #include <iostream>
#define MAX 80

#include <string>

using namespace std;

int main()
{
	int n;
	cin >> n;
	for (int counter = 0; counter < n; counter++){
		string a, b;
		cin >> a >> b;
		if (a.length() > MAX || b.length() > MAX){
			cout << "overflow" << endl;
			continue;
		}
		int inta[MAX + 2], intb[MAX + 2], sum[MAX + 2];
		fill(inta, inta + MAX + 2, 0);
		fill(intb, intb + MAX + 2, 0);
		fill(sum, sum + MAX + 2, 0);
		for (int i = 0; i < (signed)a.length(); i++){
			inta[i] = a[a.length() - i - 1] - '0';
		}
		for (int i = 0; i < (signed)b.length(); i++){
			intb[i] = b[b.length() - i - 1] - '0';
		}
		
		int over = 0;
		for (int i = 0; i < MAX + 2; i++){
			sum[i] = inta[i] + intb[i] + over;
			if (sum[i] >= 10){
				sum[i] -= 10;
				over = 1;
			}
			else{
				over = 0;
			}
		}

		for (int i = MAX + 1;; i--){
			if (sum[i] != 0){
				if (i >= MAX){
					cout << "overflow" << endl;
					break;
				}
				for (int j = i; j >= 0; j--){
					cout << sum[j];
				}
				cout << endl;
				break;
			}
		}
	}
	return 0;
}

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

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

constexpr int MAX_DIGIT = 80;
constexpr int OVERFLOW = 20;

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

    while (data_num--) {
        string in01_str, in02_str;
        cin >> in01_str >> in02_str;

        vector<int> in01(MAX_DIGIT + OVERFLOW, 0), in02(MAX_DIGIT + OVERFLOW, 0);
        for (unsigned i = 0; i < in01_str.size(); i++) {
            in01.at(i) = in01_str.at(in01_str.size() - 1 - i) - '0';
        }
        for (unsigned i = 0; i < in02_str.size(); i++) {
            in02.at(i) = in02_str.at(in02_str.size() - 1 - i) - '0';
        }

        if (in01.at(MAX_DIGIT) != 0 || in02.at(MAX_DIGIT) != 0) {
            cout << "overflow" << endl;
        }

        vector<int> out(MAX_DIGIT + OVERFLOW, 0);
        for (unsigned i = 0; i < MAX_DIGIT; i++) {
            out.at(i) += in01.at(i) + in02.at(i);
            if (out.at(i) / 10 != 0) {
                out.at(i) -= 10;
                out.at(i + 1)++;
            }
        }

        if (out.at(MAX_DIGIT) != 0) {
            cout << "overflow" << endl;
            continue;
        }

        while (out.at(out.size() - 1) == 0 && out.size() != 1) {
            out.erase(out.end() - 1);
        }

        for (unsigned i = 0; i < out.size(); i++) {
            cout << out.at(out.size() - 1 - i);
        }
        cout << endl;
    }
}

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

using namespace std;

void tasu(string s1, string s2){
        int num[2][max(s1.length(), s2.length())+1];
        for(int i = 0; i < sizeof(num[0])/sizeof(int); i++){
                if(s1.length() > i){ 
                        num[0][i] = (int)s1.at(s1.length()-1-i) - (int)'0';
                }else{
                        num[0][i] = 0;
                }   
                if(s2.length() > i){ 
                        num[1][i] = (int)s2.at(s2.length()-1-i) - (int)'0';
                }else{
                        num[1][i] = 0;
                }   
        }   
        for(int i = 0; i < sizeof(num[0])/sizeof(int)-1; i++){
                num[1][i] += num[0][i];
                if(num[1][i] > 9){ 
                        num[1][i+1] += (int)(num[1][i]/10);
                        num[1][i] %= 10; 
                }   
        }   
        int keta = sizeof(num[0])/sizeof(int);
        while(keta && !num[1][keta-1]){
                keta--;
        }   
        if(keta > 80){
                cout << "overflow" << endl;
        }else{
                while(keta--){
                        cout << num[1][keta];
                }   
                cout << endl;
        }   
}
int main(){
        int n;
        cin >> n;
        while(n--){
                string s1, s2; 
                cin >> s1 >> s2; 
                tasu(s1, s2);
        }   
}