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<algorithm>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

using namespace std;
int main(){
	int n,l,m,c;
	char a[90],b[90],s[90];
	cin >> n;
	for(int i=0;i<n;i++){
		for(int j=0;j<90;j++)s[j]=0;
		scanf("%s%s",a,b);
		l = strlen(a);
		m = strlen(b);
		reverse(a,a+l);
		reverse(b,b+m);
		c=0;
		for(int j=0;j<max(l,m);j++){
			int o=c;
			if(j<l)o += a[j]-'0';
			if(j<m)o += b[j]-'0';
			c = o>9;
			s[j] = o%10 + '0';
		}
		l=max(l,m);
		if(c>0)s[l++]='1';
		reverse(s,s+l);
		if(l>80)puts("overflow");
		else puts(s);
	}
	return 0;
}

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

int main()
{
	int n;
	cin >> n;
	for (int counter = 0; counter < n; counter++){
		string a, b;
		cin >> a >> b;
		int inta[82], intb[82], sum[82];
		fill(inta, inta + 82, 0);
		fill(intb, intb + 82, 0);
		fill(sum, sum + 82, 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 < 82; i++){
			sum[i] = inta[i] + intb[i] + over;
			if (sum[i] >= 10){
				sum[i] -= 10;
				over = 1;
			}
			else{
				over = 0;
			}
		}

		for (int i = 81;; i--){
			if (sum[i] != 0){
				for (int j = i; j >= 0; j--){
					cout << sum[j];
				}
				cout << endl;
				break;
			}
		}
	}
	return 0;
}

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;
  }
}