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<stdio.h>
#include <algorithm>
#include <utility>
using namespace std;
using namespace std;
int main(){
	
	int m;
	char in[2][100];
	char ans[100];
	int ie[2];
	int ien[2];
	bool max10;
	int Min;
	bool NMin;
	scanf("%d",&m);
	for(;m--;){
		
		for(int i=0;i<2;i++){
			scanf(" %s",&in[i]);
		}
		for(int i=0;i<2;i++){
			for(ie[i]=0;in[i][ie[i]]!='\0';ie[i]++){
			}
		}
		ie[0]--;
		ie[1]--;
		Min=max(ie[0],ie[1]);
		if((Min>79)||((Min>78)&&(ie[0]==ie[1])&&((int(in[0][0])+int(in[1][0]))>9))){
			cout<<"overflow"<<endl;
		}else{	
			if(ie[0]>ie[1]){
				NMin=0;
			}else{
				NMin=1;
			}
			ien[0]=ie[0];
			ien[1]=ie[1];
			for(;min(ien[0],ien[1])+1;ien[0]--,ien[1]--){
				in[NMin][ien[NMin]]=in[0][ien[0]]+in[1][ien[1]]-'0';
				if(in[NMin][ien[NMin]]>9+'0'){
					in[NMin][ien[NMin]]-=10;
					in[NMin][ien[NMin]-1]  +=1;
				}
			}
			max10=0;
			for(;ien[NMin]>-1;ien[NMin]--){
				if(in[NMin][ien[NMin]]>9+'0'){
					in[NMin][ien[NMin]]-=10;
					in[NMin][ien[NMin]-1]+=1;
					max10=1;
				}else{
					max10=0;
				}
			}
			if(max10) cout<<"1";
			cout<<in[NMin]<<endl;
		}
	}
	return 0;
}

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;
        
        if((int)(d.size())>80||(int)(e.size())>80){
            printf("overflow");
        }else{
            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 <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>

using namespace std;

int main (int argc, char * const argv[]) {
    // insert code here...
	int n;
    string a, b;
		
	cin>> n;	
	for(int i=0;i<n;i++){
		int x[81]={0}, y[81]={0};

		cin >> a;
		cin >> b;
		
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());
		
		for(int j=0;j<a.size();j++){
			x[j]=a[j]-'0';
		}
		for(int j=0;j<b.size();j++){
			y[j]=b[j]-'0';
		}
		
		for(int j=0;j<80;j++){
			x[j]=x[j]+y[j];
			if(x[j]>=10){
				x[j+1]++;
				x[j]-=10;
			}
		}
		
		if(x[80]>0){
			cout << "overflow" <<endl;
		}else{
			bool flag = 0;
			for(int j=79;j>=0;j--){
				if(x[j]!=0){
					cout<<x[j];
					flag=1;
				}else if(flag){
					cout<<x[j];
				}
			}
			cout<<endl;
		}
	}
	
	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstring>
using namespace std;
string S, T; int n, x[10000], a[10000], b[10000], cnt; char U[11] = "0123456789";
int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> S >> T;
		memset(x, 0, sizeof(x));
		for (int i = 0; i < S.size(); i++) {
			for (int j = 0; j < 10; j++) {
				if (U[j] == S[i]) {
					a[i] = j;
				}
			}
		}
		for (int i = 0; i < T.size(); i++) {
			for (int j = 0; j < 10; j++) {
				if (U[j] == T[i]) {
					b[i] = j;
				}
			}
		}
		if (S.size() > 80 || T.size()>80) {
			cout << "OVERFLOW" << endl; goto E;
		}
		for (int i = 0; i < 80; i++) {
			x[i] += (a[i] + b[i]) % 10;
			x[i + 1] += (a[i] + b[i]) / 10;
		}
		if (x[80] > 0) {
			cout << "OVERFLOW" << endl;
		}
		else {
			for (int i = 79; i >= 0; i--) {
				if (x[i] > 0) { cnt++; }
				if (cnt) { cout << x[i]; }
			}
			cout << endl;
		}
	E:;
	}
}

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

const int MAX_SIZE = 128;

#define toI(x) (x-'0')

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] = -1;
    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] == -1 && r.d[i] == -1){
	if(!updigit)
	  continue;
	this->d[i] = updigit+'0';
	updigit = 0;
	tmp++;
      }else{
	if(this->d[i] != -1)
	  a = toI(this->d[i]);
	if(r.d[i] != -1)
	  b = toI(r.d[i]);
	int n = a + b + updigit;
	updigit = n / 10;
	this->d[i] = (n % 10)+'0';
      }
    }
    this->size = tmp;
    return;
  }

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

int main()
{
  int d;
  scanf("%d", &d);
  while(d--){
    char s1[128], s2[128];

    scanf("%s",s1);
    scanf("%s",s2);
    Z z1(s1);
    Z z2(s2);
    z1.add(z2);

    z1.print();
  }
  return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include <utility>
using namespace std;
using namespace std;
int main(){
	
	int m;
	char in[2][100];
	char ans[100];
	int ie[2];
	int ien[2];
	bool max10;
	int Min;
	bool NMin;
	scanf("%d",&m);
	for(;m--;){
		
		for(int i=0;i<2;i++){
			scanf(" %s",&in[i]);
		}
		for(int i=0;i<2;i++){
			for(ie[i]=0;in[i][ie[i]]!='\0';ie[i]++){
				in[i][ie[i]]=in[i][ie[i]]-'0';
			}
		}
		ie[0]--;
		ie[1]--;
		Min=max(ie[0],ie[1]);
		cout<<"Min"<<Min<<endl;
		if((Min>79)||((Min>78)&&(ie[0]==ie[1])&&((int(in[0][0])+int(in[1][0]))>9))){
			cout<<"overflow"<<endl;
		}else{	
			if(ie[0]>ie[1]){
				NMin=0;
			}else{
				NMin=1;
			}
			ien[0]=ie[0];
			ien[1]=ie[1];
			for(;min(ien[0],ien[1])+1;ien[0]--,ien[1]--){
				in[NMin][ien[NMin]]=in[0][ien[0]]+in[1][ien[1]];
				if(in[NMin][ien[NMin]+1]>9){
					in[NMin][ien[NMin]+1]-=10;
					in[NMin][ien[NMin]]  +=1;
				}
			}
			max10=0;
			
			for(;ien[NMin]>-1;ien[NMin]--){
				in[NMin][ien[NMin]]=in[NMin][ien[NMin]];
				if(in[NMin][ien[NMin]+1]>9){
					in[NMin][ien[NMin]+1]-=10;
					in[NMin][ien[NMin]]  +=1;
				}
			}
			for(int i=0;i<2;i++){
				for(int j=0;j<ie[i]+1;j++){
					in[i][j]=in[i][j]+'0';
				}
			}
			
			if(max10) cout<<"1";
			cout<<in[NMin]<<endl;
		}
	}
	return 0;
}