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>

using namespace std;

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++: #include<iostream>
#include<string>
#include<cstdlib>
#include<stdio.h>

int inttostring(char *x,int n){
  return sprintf(x,"%d",n);
}

int main(){
  std::string a;
  std::string b;
  char sum[102];
  int num_a,num_b,num_sum,size_sum;
  int n;

  std::cin >> n;

  for(int i=0;i<n;i++){
    std::cin >> a >> b;
    num_a = std::atoi(&a[0]);
    num_b = std::atoi(&b[0]);

    num_sum = num_a+num_b;
    //sum = std::to_string(num_sum);

    size_sum = inttostring(sum,num_sum);

    if(size_sum>80){
      std::cout << "overflow" << std::endl;
      break;
    }

    std::cout << sum << std::endl;
  }
  //std::cout << num_a << std::endl;
  //std::cout << num_b << std::endl;
}

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

string IntToString(int number) {
    stringstream ss;
    ss << number;
    return ss.str();
}

int main(){
    int n;
    cin >> n;
    for(int p=0; p < n; p++){
        string ans;
        string s, t;
        cin >> s >> t;
        if(s.size() > t.size()) swap(s, t);


        int q = t.size()-s.size();
        for(int i=0; i < q; i++) s = "0" + s;

        int up = 0;
        for(int i=s.size()-1; 0 <= i; i--){
            int d = atoi(s.substr(i, 1).c_str());
            int f = atoi(t.substr(i, 1).c_str());
            ans = IntToString((d+f+up)%10) + ans;

            if(0 <= d+f+up-10) up = 1;
            else up = 0;
        }
        if(up == 1) ans = IntToString(1) + ans;

        if(80 < ans.size()) cout << "overflow" << endl;
        else cout << ans << endl;
     }
}

C++: #include <iostream>
#include <stdio.h>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <set>
#include <math.h>
#include <utility>
#include <stack>
using namespace std;
typedef pair<int,int> P;
const int INF = ~(1<<31) / 2;

int main(){
    int k;
    cin >> k;
    for(int j=0;j<k;j++){
        int n[80];
        string a,b;
        cin >> a >> b;
        int n_a = a.size(),n_b = b.size();
        if(n_a>80||n_b>80){cout << "overflow" << endl;continue;}

        fill(n,n+80,0);
        bool is_over = false;
        for(int i=0;i<max(n_a,n_b);i++){
            int ai,bi;
            if (i<n_a) ai = a[n_a-i-1]-'0';
            else ai = 0;
            if (i<n_b) bi = b[n_b-i-1]-'0';
            else bi = 0;
            n[i] += ai + bi;
            if (n[i]>=10){
                if(i+1 == 80){
                    is_over = true;
                    break;
                }else{
                    n[i+1] += n[i]/10;
                    n[i] = n[i]%10;
                }
            }
        }
        if (is_over){
            cout << "overflow" << endl;
        }else{
            bool started = false;
            for(int i=79;i>=0;i--){
                if(!started && n[i]>0){
                    started = true;
                }
                if(started || (!started&&i==0)){
                    cout << n[i];
                }
            }
            cout << endl;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
typedef vector <int> vi;
typedef vector <string> vs;

string right(string &text, int n){
	int length = text.size();
	string tmp;
	tmp = text.substr(length-n, n);
	text = text.substr(0, length-n);
	return tmp;
}

long str2lng(string text){
	stringstream ss;
	ss<<text;
	long tmp;
	ss>>tmp;
	return tmp;
}

string lng2str(long n){
	stringstream ss;
	ss<<n;
	string text;
	ss>>text;
	return text;
}

vi longstr2num(string text){
	vi buf;
	while (!text.empty()){
		if (text.size()>=8)
			buf.push_back(str2lng(right(text, 8)));
		else{
			buf.push_back(str2lng(text));
			text="";
		}
	}
	return buf;
}

int main(void){
	int n;
	cin>>n;
	for (int i=0; i<n; i++){
		string s1, s2;
		cin>>s1>>s2;
		vi tmp, tmp1 = longstr2num(s1), tmp2 = longstr2num(s2);
		int size1 = tmp1.size(), size2 = tmp2.size(), size=max(size1, size2);
		long s, c = 0;
		for (int j=0; j<size; j++){
			s = c;
			if (j<size1) s += tmp1[j];
			if (j<size2) s += tmp2[j];
			
			tmp.push_back(s%100000000);
			c = s / 100000000;
		}
		if (c != 0)	tmp.push_back(c);

		stringstream buf;
		for (int j=tmp.size()-1; j>=0; j--)
			if (j != tmp.size()-1)
				buf<<setfill('0')<<setw(8)<<tmp[j];
			else
				buf<<tmp[j];
		string str;
		buf>>str;
		if (str.size()>80) cout<<"overflow"<<endl;
		else cout<<str<<endl;
	}
	return 0;
}

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

using namespace std;

int main(int argc, char* argv[])
{
	int i;
	int num, pos;
	int len1, len2;
	char temp;
	char f1[101] = { 0 }, f2[101] = { 0 };
	int  up[100] = { 0 };
	int  sum[101] = { 0 };

	cin >> num;
	while (num--) {
		cin >> f1;
		cin >> f2;

		len1 = strlen(f1);
		len2 = strlen(f2);
		if (len1 > 80 || len2 > 80) {
			cout << "overflow" << endl;
			continue;
		}

		for (int i = 0; i < len1 / 2; i++) {
			temp = f1[i];
			f1[i] = f1[len1 - 1 - i];
			f1[len1 - 1 - i] = temp;
		}
		for (int i = 0; i < len2 / 2; i++) {
			temp = f2[i];
			f2[i] = f2[len2 - 1 - i];
			f2[len2 - 1 - i] = temp;
		}

		for (i = 0; i < len1; i++) f1[i] = f1[i] - 0x30;
		for (i = 0; i < len2; i++) f2[i] = f2[i] - 0x30;

		for (int i = 0; i < 100; i++) {
			sum[i] += (f1[i] + f2[i]);
			if (sum[i] >= 10) {
				sum[i] -= 10;
				sum[i + 1]++;
			}
		}

		for (pos = 100; sum[pos] == 0; pos--) {}
		if (pos >= 80) {
			cout << "overflow";
			break;
		}
		for (int i = pos; i >= 0; i--) {
			cout << sum[i];
		}
		cout << endl;
	}
}