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 stoi{//stoi??????¨??????????????????????????????????????????§???£??¨???????
 
    int stoi(std::string str){
        int ret;
        std:: stringstream ss;
        ss << str;
        ss >> ret;
        return ret;
    }
 
}
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_Max, str_rest;
 
    str_Max = str.length() / CAPACITY;//
    str_rest = str.length() % CAPACITY;
 
        for (int j = str.length() - CAPACITY; str_Max > 0; j = j-CAPACITY){
        num_str[k] = stoi::stoi(str.substr(j, CAPACITY));
        loc = k;
        k--;
        str_Max--;
    }
    //?????????????????????????????????????????\??????
     
        if(str_rest!=0)num_str[loc - 1] = stoi::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;
 
    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++;
                std::cout << num_ans[j];
 
            }
            else if (num_ans[j] == 0 && count >= 1){
                std::cout << "000000000";
            }
 
        }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);
        OverDigit OverDigit_a(str_a,str_b);//????????????§??????
        OverDigit_a.Add();
    }
 
    return 0;
}

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

int main()
{
int x,h;
double a,b;
cin>>x;
for(int i=0; i<x; i++)
{
 while(true)
 {
  cin>>a>>b;
  if(a.size()>=80||b.size()>=80) break;
  else
  {
   cout<<a+b<<endl;
  }
 }
}
return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
class Longint{
  vector<long long> V;
public:
  Longint(string s);
  int size();
  void print();
  Longint operator+(const Longint &o);
  Longint operator+=(const Longint &o);
};

int Longint::size(){
  return (this->V.size()-1)*9+to_string(V.back()).size();
}

void Longint::print(){
  printf("%lld",this->V.back());
  for (int i=this->V.size()-2;i>=0;i--){
    printf("%09lld",this->V[i]);
  }
}

Longint Longint::operator+(const Longint &o){
  Longint R("");
  const long long MOD = 1000000000;
  int i,k = max(this->V.size(),o.V.size());
  for(i=0;i<k;i++){
    R.V.push_back(0);
    if(i<this->V.size()){
      R.V.back() += this->V[i];
    }
    if(i<o.V.size()){
      R.V.back() += o.V[i];
    }
  }
  for(i=0;i<k-1;i++){
    R.V[i+1] += R.V[i]/MOD;
    R.V[i] %= MOD;
  }
  if(R.V[k-1]>=MOD){
    R.V.push_back(R.V[k-1]/MOD);
    R.V[k-1]%=MOD;
  }
  return R;
}

Longint Longint::operator+=(const Longint &o){
  return *this = *this+o;
}

Longint::Longint(string s){
  int n=s.size(),i,j = 0;
  long long d,h[9] = {1,10,100,1000,10000,100000,1000000,10000000,100000000};
  for (i=n-1;i>=0;i--){
    d=s[i]-'0';
    if(j == 0){
      this->V.push_back(d);
    }
    else{
      this->V.back() += d*h[j];
    }
    j = (j+1)%9;
  }
}

int main(){
  int t,i;cin >> t;
  string a,b;
  for(i=0;i<t;i++){
    cin >> a >> b;
    Longint G(a),H(b);
    G += H;
    if(G.size() > 80) printf("overflow");
    else G.print();
    printf("\n");
  }
}

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


int main(){
  int n,i,j;
  
  
  int up = 0;
  cin >> n;
  for(i=0;i<n;i++){
    int sum[110]={};
    string a,b;
    up = 0;
    cin >> a >> b;
    int sa=a.size(),sb=b.size();
    int flag=0;
    if(max(sa,sb)>80) flag =1;
    else 
    for(j=0;j<max(sa,sb);j++){
      if(sa>j&&sb>j){
	sum[j] = (a[sa-j-1]-'0') + (b[sb-j-1]-'0') + up;
      }else if(sa>j){
	sum[j] = (a[sa-j-1]-'0') + up;
      }else if(sb>j){
	sum[j] = (b[sb-j-1]-'0') + up;
      }
      up=0;
      if(sum[j]>9){
	up=1;
	sum[j]-=10;
      }
    }
    sum[max(sa,sb)]=up;
    int k=max(sa,sb);
    while(sum[k]==0&&k>0) k--;
    if(k>=80||flag==1) cout << "overflow";
    else
    for(j=k;j>=0;j--)
      cout << sum[j];
    cout << endl;
  }
}

C++: #include<iostream>
#include<string>
#include<cmath>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int stoi(string s){
  int size=s.size();
  int num=0;
  rep(i,size){
    num+=((int)s[i]-'0')*pow(10,size-i-1);
  }
  return num;
}

string itos(int num){//this function is used when you want to change variable type from int to string
  int size=0;
  int cnt=1;
  while(num/cnt!=0){//count the digit of num
    size++;
    cnt*=10;
  }
  string s="";
  rep(i,size){//change num from int to string
    s+=(char)((num/(int)pow(10,size-i-1))+'0');
    num-=(int)(num/pow(10,size-i-1))*pow(10,size-i-1);
  }
  return s;
}

int main(){
	int n;
	cin>>n;
	string s[2];
	rep(i,n){
		cin>>s[0]>>s[1];
		if(s[0].size()>=80 || s[1].size()>=80){
			cout<<"overflow"<<endl;
			continue;
		}
		int dis=abs(s[0].size()-s[1].size());
		if(s[0].size()>s[1].size()){
			rep(j,dis){
				s[1].insert(0,"0");
			}
		}else{
			rep(j,dis){
				s[0].insert(0,"0");
			}
		}
		int size=s[0].size();
		int alt=0;
		string ans="";
		int num1,num2;
		for(int a=(size-1);a>=0;a--){
			num1=(int)s[0][a]-'0';
			num2=(int)s[1][a]-'0';
			int result=num1+num2+alt;
			if(result<10){
				if(!result)ans.insert(0,"0");
				else ans.insert(0,itos(result));
				alt=0;
			}else{
				if(!(result%10))ans.insert(0,"0");
				else ans.insert(0,itos(result%10));
				alt=1;
			}
		}
		if(alt)ans.insert(0,"1");
		if(ans.size()>=80)cout<<"overflow"<<endl;
		else cout<<ans<<endl;
	}
	return 0;
}