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<stack>
using namespace std;

int main(void){
  string x,y;
  int tmp, c;
  int N;
  int cnt;
  cin >> N;

  for(int i = 0; i < N; i++){
    stack<int> a, b, ans;
    cnt = 0;

    cin >> x;
    cin >> y;

    for(int j = 0; j < x.length(); j++){
      a.push(x[j] - '0');
    }
    for(int j = 0; j < y.length(); j++){
      b.push(y[j] - '0');
    }

    c = 0;

    while(a.empty() != true || b.empty() != true){
      tmp = 0;
      
      if(a.empty() != true){
	tmp += a.top();
	a.pop();
      }
      if(b.empty() != true){
	tmp += b.top();
	b.pop();
      }
      tmp += c;

      ans.push(tmp % 10);
      cnt++;

      if(tmp >= 10)
	c = tmp / 10;
      else
	c = 0;
    }

    if(c != 0){
      ans.push(c);
      cnt++;
    }

    if(cnt > 80)
      cout << "overflow" << endl;
    else{
      while(ans.empty() != true){
	cout << ans.top();
	ans.pop();
      }
      cout << endl;
    }
  }
  return 0;
}

C++: #include <stdio.h>

#define DEGITS 8

void load(int a[]);
void print(int a[]);

int main(void){
    int a[DEGITS]; // a[0] = LSD
    int b[DEGITS];
    int n;
    int cry;
    
    scanf("%d", &n);
    for (int i=0; i<n; i++){
        // reset
        for (int i=0; i<DEGITS; i++){
            a[i]=b[i]=0;
        }
        // load
        load(a);
        load(b);
        // add ( a <- a + b )
        cry=0;
        for (int d=0; d<DEGITS; d++){
            a[d] += (b[d] + cry);
            cry = a[d]/10;
            if (a[d]>9){
                a[d]-=10;
            }
        }
        // print
        if (cry){
            printf("overflow\n");
        } else{
            print(a);
        }
    }

    return 0;
}

void load(int a[]){
    char *pt;
    char st[DEGITS+1];
    
    scanf("%s", st);
    for (pt=st; *pt!='\0'; pt++) ;
    for (int i=0; pt!=st; i++){
        a[i] = *(--pt)-'0';
    }
}

void print(int a[]){
    int d;
    
    for (d=DEGITS-1; d>0; d--){ 
        if (a[d] != 0) break;
    }
    for (; d>0; d--) printf("%d", a[d]);
    printf("%d\n", a[0]);
}

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

int main(){
  std::string str1,str2,sumstr;
  int n;
  std::cin>>n;
  std::vector<std::string> ans;
  while((ans.size()<n)&&std::cin>>str1>>str2){
    sumstr.clear();
    std::reverse(str1.begin(),str1.end());
    std::reverse(str2.begin(),str2.end());
    unsigned size=std::min(str1.size(),str2.size());
    unsigned i;
    unsigned carry=0;
    for(i=0;i<size;++i){
      unsigned sum=str1[i]+str2[i]+carry-'0'*2;
      sumstr.push_back(sum%10+'0');
      carry=sum/10;
    }
    std::string large=(str1.size()>str2.size())?str1:str2;
    for(;i<large.size();++i){
      unsigned sum=large[i]+carry-'0';
      sumstr.push_back(sum%10+'0');
      carry=sum/10;
    }
    if(carry)sumstr.push_back(carry+'0');
    std::reverse(sumstr.begin(),sumstr.end());
    sumstr.push_back('\0');
    ans.push_back(sumstr);
  }
  for(auto s:ans){
    if(s.size()<=81)
      std::cout<<s<<std::endl;
    else
      std::cout<<"overflow"<<std::endl;
  }
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#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;
			}
		}
		cout << 0 << endl;
		/*
		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 <stdio.h>
#include <string.h>
int main(void){
    int ap,bp,cp,t;
    char a[999],b[999],c[82];
    scanf("%d",&t);
    while(~scanf("%s%s",&a,&b)){
        ap=strlen(a);
        bp=strlen(b);
        c[cp=(ap>80||bp>80)?0:81]='\0';
        t=0;
        while((t||ap||bp)&&cp>0){
            t+=(ap?a[--ap]-'0':0)+(bp?b[--bp]-'0':0);
            c[--cp]='0'+t%10;
            t/=10;
        }
        if(cp>0)puts(&c[cp]);
        else puts("overflow");
    }
    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;
        
    }
    
    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++: #define _CRT_SECURE_NO_WARNINGS
#define M_PI 3.14159265358979
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include <algorithm>
#include <cstdlib>
#include <typeinfo>
using namespace std;



int main(){
	int n,m;
	string x, y,z;
	double a, b, c;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> x >> y;
		if (x.length() > 80 || y.length() > 80)
		{
			cout << "overflow" << endl;
		}
		else
		{
			a = stod(x);
			b = stod(y);
			if (to_string(a + b).length() > 80)
			{
				cout << "overflow" << endl;
			}
			else
			{
				z = to_string(a + b);
				z.erase(z.begin() + z.length() - 7, z.begin() + z.length());

				cout << z << endl;
			}
		}
	}
}