Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Scan()
	dataset, _ := strconv.Atoi(sc.Text())
	var firstdata *big.Int

	for i := 0; i < dataset*2; i++ {
		n := new(big.Int)
		sc.Scan()
		data, _ := n.SetString(sc.Text(), 10)

		if i%2 == 0 {
			firstdata = data
			continue
		}

		result := new(big.Int)
		if result := result.Add(data, firstdata); len(result.String()) > 80 {
			fmt.Println("overflow")
			continue
		} else {
			fmt.Println(result)
		}
	}
}

C++: #include <iostream>
#include <vector>
#include<string>
#include<sstream>
#define CAPACITY 9


namespace jisaku{//stoi?????¨?????????????????????????????????????????§??£?¨???????

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

     std::string to_string(int i){
		 std::string text;
		std::stringstream textline;
		textline<< i;
		textline >> text;
		return text;
	}

}




class OverDigit{

public:

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

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

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

}

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

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

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

	for (int j = str.length() - CAPACITY; str_Max > 0; j = j - CAPACITY){
		num_str[k] = jisaku::stoi(str.substr(j, CAPACITY));
		loc = k;
		k--;
		str_Max--;

	}
	//?????????????????????????????????????????\??????

	if (str_rest != 0)num_str[loc - 1] = jisaku::stoi(str.substr(0, str_rest));

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

	int num_ans[CAPACITY] = {};
	int fat, overflow = 0, count = 0;
	std::string text,t;


	for (int j = CAPACITY - 1; 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){
			fat = (num_a[j] + num_b[j]) - 1000000000;
			num_ans[j] = fat;
			num_a[j - 1]++;
		}

	}

	if (num_a[0] + num_b[0] > 99999999){
		overflow = 1;
	}
	else{
		num_ans[0] = num_a[0] + num_b[0];


	}

	if (overflow == 1){
		std::cout << "overflow" << std::endl;
	}
	else {
		for (int j = 0; j < CAPACITY; j++){
			
          if (num_ans[j] != 0){
				count++;
				t = jisaku::to_string(num_ans[j]);
				if (t.length() != 9){
					for (int l = 0; l < (9 - t.length()); l++){
						text += "0";
					}
				}
				text += t;


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

		}

		int count = 0;
		for (int l = 0; l < text.length(); l++){
			if (count == 0 && text[l] == '0'){
			}
			else {
				std::cout << text[l];
				count++;
			}
		}std::cout << std::endl;
	}

};


int main(){

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

	std::cin >> N;
	std::cin.ignore();

	for (int i = 0; i < N; i++){
		getline(std::cin, str_a);
		getline(std::cin, str_b);
		if (str_a == "0" && str_b == "0"){std::cout << '0' << std::endl;
		}
		else if (str_a.length() >= 81 || str_b.length() >= 81){
		
			std::cout << "overflow" << std::endl;
		}
		else{

			OverDigit OverDigit_a(str_a, str_b);//???????????§??????
			OverDigit_a.Add();
		}
	}
	return 0;
}

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

int f( char x ){
	switch (x){
		case '0' : return 0 ;
		case '1' : return 1 ;
		case '2' : return 2 ;
		case '3' : return 3 ;
		case '4' : return 4 ;
		case '5' : return 5 ;
		case '6' : return 6 ;
		case '7' : return 7 ;
		case '8' : return 8 ;
		case '9' : return 9 ;
	}
}

int main(){
	
	int n ;
	for( cin >> n ; n-- ; ){
		string a,b ;
		cin >> a >> b ;
		if( a.size() > b.size() ) swap(a,b) ;
		reverse( a.begin() , a.end() ) ;
		reverse( b.begin() , b.end() ) ;
		while( a.size() < b.size() ) a+='0' ;
		
		vector<int> c ;
		c.push_back(0) ;
		for( int i=0 ; i<a.size() ; i++ ){
			c[i] += f(a[i]) + f(b[i]) ;
			c.push_back( c[i]/10 ) ;
			c[i] %= 10 ;
		}
		if( c[c.size()-1] == 0 ) c.pop_back() ;
		reverse( c.begin() , c.end() ) ;
		for( int i=0 ; i<c.size() ; i++ ) cout << c[i] ;
		cout << endl ;
	}
	
return 0 ;
}

C++: #include <vector>
#include <iostream>
#include <set>
#include <cstdio>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <ctime>
#include <cmath>
#include <complex>
#include <algorithm>
#include <tuple>
#include <algorithm>
#include <limits>
#include <map>
#include <valarray>
#include <list>

using namespace std;

typedef long long ll;

int main() {
    int t;
    cin >> t;
    while (t--) {
        string s1, s2;
        cin >> s1 >> s2;
        if (s1 == "0" && s2 == "0") {
            cout << "0" << endl;
            continue;
        }
        reverse(s1.begin(), s1.end());
        reverse(s2.begin(), s2.end());
        int n = max(s1.size(), s2.size()) + 1;
        for (int i = s1.size(); i < n; i++) {
            s1 += '0';
        }
        for (int i = s2.size(); i < n; i++) {
            s2 += '0';
        }
        string res;
        int b = 0;
        for (int i = 0; i < max(s1.size(), s2.size()); i++) {
            int u = s1[i]-'0'+s2[i]-'0'+ b;
            b = (u >= 10); u %= 10;
            res += u + '0';
        }
        reverse(res.begin(), res.end());
        string res2;
        int j = 0;
        while (res[j] == '0') j++;
        for (; j < res.size(); j++) {
            res2 += res[j];
        }
        if (res2.size() > 80) {
            cout << "overflow" << endl;
        } else {
            cout << res2 << endl;
        }
    }
}

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    cin.ignore();
    for(int i=0; i<n; i++){
        char a[128], b[128], c[128];
        int al, bl;
        cin.getline(a, 128);
        al=cin.gcount()-1;
        cin.getline(b, 128);
        bl=cin.gcount()-1;
        int j=al, k=bl, carry=0, l=0;
        while(true){
            j--, k--;
            if(j<0||k<0) break;
            c[l]=a[j]+b[k]+carry-'0';
            if(c[l]>'9'){
                c[l]-=10;
                carry=1;
            } else {
                carry=0;
            }
            ++l;
        }

        if(j<0){
            ++k;
            while(--k>=0){
                c[l]=b[k]+carry;
                if(c[l]>'9'){
                    c[l]-=10;
                    carry=1;
                } else {
                    carry=0;
                }
                ++l;
            }
        }else{
            ++j;
            while(--j>=0){
                c[l]=a[j]+carry;
                if(c[l]>'9'){
                    c[l]-=10;
                    carry=1;
                } else {
                    carry=0;
                }
                ++l;
            }
        }
        if(carry==1) c[l++]='1';
        if(l>80) cout<<"overflow\n";
        else{
            while(--l>=0) cout<<c[l];
            cout<<'\n';
        }
    }
    return 0;
}