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 <cmath>
#include <cstdlib>
using namespace std;

int main(){
	int x[100];
	int y[100];
	int z[100];
	int n, i, j, hi;
	bool top;
	string a, b;
	
	cin >> n;
	for (i = 0; i < n; i++) {
		// initialize
		for(j=0; j<100; j++){
			x[j] = 0;
			y[j] = 0;
			z[j] = 0;
		}
		cin >> a;
		cin >> b;
		if(a.length() > 80 || b.length() > 80){
			cout << "overflow" << endl;
			continue;
		}
		for (j = 0; j < a.length(); j++){
			x[j] = atoi(a.substr(a.length()-1-j, 1).c_str());
		}
		for (j = 0; j < b.length(); j++){
			y[j] = atoi(b.substr(b.length()-1-j, 1).c_str());
		}
		
		hi = 0;
		for(j=0; j<80; j++){
			z[j] = x[j] + y[j] + hi;
			if(z[j] > 9){
				hi = 1;
				z[j] -= 10;
			}else{
				hi = 0;
			}
		}
		if(hi == 1){
			cout << "overflow" << endl;
		}else{
			top = false;
			for (j = 79; j > -1; j--) {
				if(z[j] == 0 && !top){
					continue;
				}else{
					top = true;
					cout << z[j];
				}
			}
			cout << endl;
		}
	}
	return 0;
}

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

string Sum(string FirstInteger, string SecondInteger)
{
	if(FirstInteger.size() < SecondInteger.size()){
		swap(FirstInteger, SecondInteger);
	}
	int Degit = FirstInteger.size();
	string AddedZero(Degit - SecondInteger.size(), '0');
	SecondInteger = AddedZero + SecondInteger;
	string SumInteger(Degit, '0');
	bool IsMoveUp = false;
	for(int i = 0; i < Degit; i++){
		int Sum = IsMoveUp + FirstInteger[Degit-1-i] - '0' + SecondInteger[Degit-1-i] - '0';
		IsMoveUp = Sum / 10;
		SumInteger[Degit-1-i] = (Sum % 10) + '0';
	}
	if(IsMoveUp){
	    SumInteger = '1' + SumInteger;
	}
	return SumInteger;
}

int main()
{
	int N;
	cin >> N;
	for(int i = 0; i < N; i++){
		string FirstInteger, SecondInteger;
		cin >> FirstInteger >> SecondInteger;
//		cout << FirstInteger << '+' << SecondInteger << endl;
		string SumInteger = Sum(FirstInteger, SecondInteger);
//		cout << SumInteger.size() << "keta" << endl;
		if(SumInteger.size() <= 80){
//		    cout << "c" << endl;
		    cout << SumInteger.c_str() << endl;
//			cout << "b" << endl;
		}else{
			cout << "overflow" << endl;
		}
//		cout << "a" << endl;
	}
	return 0;
}

C++: #include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<complex>
#include<cmath>
#include<algorithm>
#include<map>
#include<vector>
#include<sstream>
#include<iostream>
using namespace std;
string str_plus(string s,string t){
    reverse(s.begin(),s.end());
    reverse(t.begin(),t.end());

    string u = "0";
    int n1 = s.size(),n2 = t.size();
    int k = max(n1,n2);
    while(s.size()!=k)s+='0';
    while(t.size()!=k)t+='0';
    for(int i = 0;i < k ;i++){
        u[i] += s[i] - '0' + t[i] - '0';
        if(u[i]>='9')u+="1",u[i]-=10;
        else u+="0";
    }
    reverse(u.begin(),u.end());
    return u;
}
int main(void){

    int n;
    cin>>n;
    while(n--){
        string s,t;
        cin>>s>>t;
        string u = str_plus(s,t);
        if(u.length()>=80)cout<<"overflow"<<endl;
        else cout<<u<<endl;
    }


    return 0;
}

C++: #include <iostream>
#include <string>
#include <fstream>

using namespace std;

#define MAX_INT_LENGTH 80

//large integer upto 80 digits
struct largeInt{
    int vals[MAX_INT_LENGTH]; // MAX_INT_LENGTH digits
};

void toLargeInt(string str, largeInt &lv){
    int start = MAX_INT_LENGTH-str.length();
    for (int i = 0; i < MAX_INT_LENGTH; i++){
        if (i >= start)
            lv.vals[i] = (str[i-start] - '0');
        else
            lv.vals[i] = 0;
    }
}

largeInt addLargeInt(const largeInt &lv1, const largeInt &lv2){
    largeInt sum;
    int carry = 0;
    for (int i = MAX_INT_LENGTH-1; i >= 0; i--){
        int sub_sum = lv1.vals[i] + lv2.vals[i] + carry;
        sum.vals[i] = sub_sum % 10;
        carry = sub_sum / 10;
    }
    return sum;
}

string toString(const largeInt &v){
    string str(MAX_INT_LENGTH,'0');
    for (int i = 0; i < MAX_INT_LENGTH; i++)
        str[i] = v.vals[i] + '0';
    return str;
}

int main()
{
    //ifstream cin("input.txt");
    
    // input data
    int n;
    cin >> n;
    for (int i = 0; i < n; i++){
        string v1,v2;
        cin >> v1 >> v2;
        largeInt lv1, lv2;
        if (v1.length()>MAX_INT_LENGTH || v2.length()>MAX_INT_LENGTH){
            cout << "overflow" << endl;
            continue;
        }
        toLargeInt(v1,lv1);
        toLargeInt(v2,lv2);
        largeInt sum = addLargeInt(lv1,lv2);
        cout << toString(sum) << endl;
    }
   return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>

const int MAX_SIZE = 128;


using namespace std;

class Z
{
private:
  int size;
  char d[MAX_SIZE];
public:
  Z(char *s)
  {
    size = strlen(s);
    for(int i=0;i<MAX_SIZE - size;i++)
      d[i] = 0;
    for(int i=0,j=MAX_SIZE - size;j < MAX_SIZE; i++, j++)
      d[j] = s[i];
  }

  void add(Z r)
  {
    int tmp = max(this->size, r.size);
    int updigit = 0;
    for(int i=MAX_SIZE-1;i>=0;i--){
      int a = 0, b = 0;
      if(this->d[i] == 0 && r.d[i] == 0){
	if(updigit){
	  this->d[i] = '1';
	  tmp++;
	}
	goto end;
      }else{
	if(this->d[i])
	  a = this->d[i] - '0';
	if(r.d[i])
	  b = r.d[i] - '0';
	int n = a + b + updigit;
	updigit = n / 10;
	this->d[i] = (n % 10)+'0';
      }
    }
  end:
    this->size = tmp;
    return;
  }

  void print()
  {
    if(this->size > 80){
      puts("overflow");
      return;
    }
    for(int i=MAX_SIZE - this->size;i<MAX_SIZE;i++)
	putchar(d[i]);
    puts("");
  }

  int sz()
  {
    return this->size;
  }
};

int main()
{
  int x;
  scanf("%d", &x);
  char s1[1000], s2[1000];  
  for(int i=0;i<x;i++){
    scanf("%s %s",s1, s2);
    if(strlen(s1) > 80 || strlen(s2) > 80){
      puts("overflow");
      continue;
    }
    Z z1(s1);
    Z z2(s2);
    z1.add(z2);
    z1.print();
  }
  return 0;
}

C++: #include<iostream>
#include<cstdlib>
#include<cmath>
#include<string>
#include<sstream>
#include<iomanip>
using namespace std;
int main(){
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        string first,second;
        cin>>first;
        cin>>second;
        int carry=0;
        ostringstream sout;
        sout<<setfill('0')<<setw(max(first.length(),second.length()))<<first;
        first=sout.str();
        sout.str("");
        sout<<setfill('0')<<setw(max(first.length(),second.length()))<<second;
        second=sout.str();
        string ans="";
        for(int j=first.length()-1;j>=0;j--){
           int d1,d2;
           d1=first[j]-'0';
           d2=second[j]-'0';
           int sum=d1+d2+carry;
           carry=sum/10;
           char d3=sum%10+'0';
           ans=d3+ans;
        }
        if(carry==1)ans='1'+ans;
        if(ans.length()<=80)cout<<ans<<endl;
        else cout<<"overflow"<<endl;
    }
    return 0;
}