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 <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <math.h>
#include <stack>

using namespace std;

int main(){
    
    string d;
    string e;
    
    stack<char> st1;
    stack<char> st2;
    stack<int> st3;
    int n=0;
    scanf("%d",&n);
    
    for(int i=0; i<n; i++){
        cin>>d;
        cin>>e;
        
        for(int j=0; j<(int)(d.size()); j++){
            st1.push(d[j]);
        }
        for(int j=0; j<(int)(e.size()); j++){
            st2.push(e[j]);
        }
        int temp=0;
        char temp_char;
        while(st1.empty()==false||st2.empty()==false){
            if(st1.empty()==false&&st2.empty()==false){
                temp_char=st1.top();
                temp+=atoi(&temp_char);
                temp_char=st2.top();
                temp+=atoi(&temp_char);
                st1.pop();
                st2.pop();
            }else if(st1.empty()==false&&st2.empty()==true){
                temp_char=st1.top();
                temp+=atoi(&temp_char);
                st1.pop();
            }else if(st1.empty()==true&&st2.empty()==false){
                temp_char=st2.top();
                temp+=atoi(&temp_char);
                st2.pop();
            }
            st3.push(temp%10);
            temp=temp/10;
        }
        
        if(temp!=0){
            st3.push(temp);
        }
        
        if(st3.size()>80){
            printf("overflow");
        }else{
            while(st3.empty()==false){
                printf("%d",st3.top());
                st3.pop();
            }
        }
        printf("\n");
        
        
    }
    
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <deque>
class BigInt
{
  std::deque<char> m_digits;
public:
  BigInt(std::string str) {
    for(auto it = str.begin(); it != str.end(); ++it) {
      m_digits.push_back(*it - '0');
    }
  }

  BigInt(int num) {
    std::ostringstream oss;
    oss << num;
    BigInt(oss.str());
  }

  std::string str() const {
    std::string str;
    for (auto it = m_digits.begin(); it != m_digits.end(); ++it) {
      str += *it + '0';
    }
    return str;
  }

  const BigInt& operator +=(const BigInt& rhs) {
    std::deque<char> new_digits;
    auto lhs_rit = m_digits.rbegin();
    auto rhs_rit = rhs.m_digits.rbegin();

    char inc = 0;
    while (lhs_rit != m_digits.rend() &&
           rhs_rit != rhs.m_digits.rend()) {
      char temp = *lhs_rit + *rhs_rit;
      temp += inc;
      if (temp >= 10) {
        inc = temp / 10;
        temp -= inc * 10;
      }
      new_digits.push_front(temp);
      ++lhs_rit;
      ++rhs_rit;
    }

    if (lhs_rit != m_digits.rend()) {
      while (lhs_rit != m_digits.rend()) {
        char temp = *lhs_rit + inc;
        if (temp >= 10) {
          inc = temp / 10;
          temp -= inc * 10;
        } else {
          inc = 0;
        }
        new_digits.push_front(temp);
        ++lhs_rit;
      }
    }
    else if (rhs_rit != rhs.m_digits.rend()) {
      while (rhs_rit != rhs.m_digits.rend()) {
        char temp = *rhs_rit + inc;
        if (temp >= 10) {
          inc = temp / 10;
          temp -= inc * 10;
        } else {
          inc = 0;
        }
        new_digits.push_front(temp);
        ++rhs_rit;
      }
    }
    if (inc > 0) new_digits.push_front(inc);
    m_digits = new_digits;
  }
};

BigInt operator +(const BigInt& lhs, const BigInt& rhs)
{
  BigInt result(lhs);
  result += rhs;
  return result;
}

int main()
{
  int n;
  std::cin >> n;
  while (n--) {
    std::string num;
    std::cin >> num;
    BigInt num1(num);
    std::cin >> num;
    BigInt num2(num);
    
    BigInt num3 = num1 + num2;
    std::cout << num3.str() << std::endl;
  }
  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;

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, 0), in02(MAX_DIGIT, 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';
        }

        vector<int> out(MAX_DIGIT + 1, 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 <cstring>
#include <algorithm>
#include <sstream>
#define  NUM      100
using namespace std;

string error = "overflow";

int main(){
	int n;
	cin >> n;
	bool over[NUM];
	int keta[NUM];
	string a[NUM], b[NUM];
	char c[NUM][81];
	for(int i = 0; i < NUM; i++){
		for(int j = 0; j < 81; j++){
			c[i][j] = '0';
		}
	}
	for(int i = 0; i < n; i++){
		over[i] = false;
		keta[i] = 0;
		int extra = 0;
		cin >> a[i] >> b[i];
		if(a[i].size() < b[i].size()){
			swap(a[i],b[i]);
		}
		
		for(int j = 0; j < a[i].size(); j++){
			int p, q, num;
			stringstream sa, sb, sc;
			sa << a[i][a[i].size()-j-1];
			sa >> p;
			if(j < b[i].size()){
				sb << b[i][b[i].size()-j-1];
				sb >> q;
			}
			else{
				q = 0;
			}
			if(p+q+extra < 10){
				sc << p+q+extra;
				sc >> c[i][j];
				extra = 0;
			}
			else{
				int kurai;
				kurai = (p+q+extra)%10;
				sc << kurai;
				sc >> c[i][j];
				extra = 1;
				if(j == a[i].size()-1){
					c[i][a[i].size()] = '1';
					keta[i] = 1;
				}
			}
		}
		if(c[i][80] != '0'){
			over[i] = true;
		}
	}
	for(int i = 0; i < n; i++){
		if(over[i] == true){
			cout << error;
		}
		else{
			for(int j = 0; j < a[i].size()+keta[i]; j++){
			cout << c[i][a[i].size()+keta[i]-j-1];
			}
		}
		cout << endl;
	}
}

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

std::string add(std::string,std::string);

int main(){
  std::string n,m;
  int size;
  std::cin>>size;
  std::vector<std::string> sums;
  for(int i=0;i<size;++i){
    std::cin>>n>>m;
    std::string sum = add(n,m);
    if(sum.length()<=80)
      sums.push_back(sum); 
    else
      sums.push_back("overflow"); 
  }

  for(auto s:sums)
    std::cout<<s<<std::endl;

  return 0;
}

std::string add(std::string n,std::string m){
  if(n.length()>m.length()) std::swap(n,m);
  std::reverse(n.begin(),n.end());
  std::reverse(m.begin(),m.end());
  std::string sum;
  char c=0,s,t;
  for(int i=0;i<m.length()||c==1;++i){
    t = (i<n.length()?n[i]-'0':0)+(i<m.length()?m[i]-'0':0)+c;
    s = t%10;
    c = t/10;
    sum.push_back(s+'0');
  }
  
  std::reverse(sum.begin(),sum.end());
  sum.push_back('\0');
  return sum;
}