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

int main(void){

	int N,math1,math2,kuri,keta;
	int i,j,k;
	char fi[100],se[100],ans[100];

	scanf("%d",&N);

	for(i=0;i<N;i++){

		scanf("%s",&fi);
		scanf("%s",&se);

		/*
		for(j=strlen(fi)-1,k=strlen(se)-1,keta=0,kuri=0;j>=0||k>=0;j--,k--,keta++){
			if(j<0) math1=0;
			else math1=fi[j]-'0';
			if(k<0) math2=0;
			else math2=se[k]-'0';
            ans[keta]=((math1+math2+kuri)%10)+'0';
			kuri=(math1+math2+kuri)/10;
		}
		if(kuri==1) printf("1");
		if(keta-1<=80){
			for(j=keta-1;j>=0;j--){
				printf("%c",ans[j]);
			}
		}
		
		else printf("overflow");
		*/
		printf("\n");
	}

	return 0;
}

C++: #include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
const int DIGIT=9;

int main() {
  int n;
  char buf[90];
  int l, x[2], y, z;
  char buf_part[DIGIT+10];
  int a[2][10];
  int b[10];

  cin >> n;
  while (n--) {
    for (int i=0; i<2; i++) {
      cin >> buf;
      l = strlen(buf);
      x[i] = (l+DIGIT-1)/DIGIT;
      y = (l-1)%DIGIT+1;
      for (int j=0; j<9; j++) {
        a[i][j] = 0;
      }
      for (int j=0; j<x[i]; j++) {
        if (!j) {
          memcpy(buf_part, buf, y);
          buf_part[y] = '\0';
        } else {
          memcpy(buf_part, &buf[y+DIGIT*(j-1)], DIGIT);
          buf_part[DIGIT] = '\0';
        }
        a[i][x[i]-j-1] = atoi(buf_part);
      }
    }

    for (int i=0; i<9; i++) b[i] = 0;
    z = (x[0] > x[1]) ? x[0] : x[1];
    for (int i=0; i<z; i++) {
      b[i] = a[0][i] + a[1][i];
      if (b[i] >= 1000000000) {
        a[0][i+1]++;
        b[i] -= 1000000000;
      }
    }
    if (z<9 && a[0][z]) {
      b[z] = a[0][z]+a[1][z];
      ++z;
    }
    if (b[8] >= 100000000) {
      cout << "overflow" << endl;
    } else {
      cout << b[z-1];
      for (int i=z-2; i>=0; i--) {
        cout.fill('0');
        cout.width(DIGIT);
        cout << b[i];
      }
      cout << endl;
    }
  }
  return 0;
}

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

std::string add(std::string,std::string);

int main(){
  std::string n,m;
  int size;
  std::cin>>size;
  std::vector<std::string> sums;
  for(int i=0;i<size;++i){
    std::cin>>n>>m;
    std::string sum = add(n,m);
    if(sum.length()<=80)
      sums.push_back(sum); 
    else
      sums.push_back("overflow"); 
  }

  for(auto s:sums)
    std::cout<<s<<std::endl;

  return 0;
}

std::string add(std::string n,std::string m){
  if(n.length()>m.length()) std::swap(n,m);
  std::reverse(n.begin(),n.end());
  std::reverse(m.begin(),m.end());
  std::string sum;
  char c=0,s,t;
  for(int i=0;i<m.length()||c==1;++i){
    t = (i<n.length()?n[i]-'0':0)+(i<m.length()?m[i]-'0':0)+c;
    s = t%10;
    c = t/10;
    sum.push_back(s+'0');
  }
  
  std::reverse(sum.begin(),sum.end());
  sum.push_back('\0');
  return sum;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(void){
	int n;
	string s,t,ans;
	int nn,mm;
	int i,j,k;
	int flg[101];
	int x,y,z;
	cin>>n;
	for(i=0;i<n;i++){
		cin>>s>>t;
		reverse(s.begin(),s.end());
		reverse(t.begin(),t.end());
		for(j=0;j<max(s.size(),t.size());j++)	flg[j]=0;
		if(s.size()>t.size()){
			nn=s.size()-t.size();
			for(j=0;j<nn;j++)	t+='0';
		}
		else{
			nn=t.size()-s.size();
			for(j=0;j<nn;j++)	s+='0';
		}
		ans.clear();
		for(j=0;j<s.size();j++){
			x=s[j]-'0';
			y=t[j]-'0';
			z=x+y+flg[j];
			flg[j+1]=z/10;
			ans+=z%10+'0';
		}
		if(flg[s.size()]>0)		ans+=flg[s.size()]+'0';
		if(ans.size()>80)	cout<<"overflow"<<endl;
		else{
			reverse(ans.begin(),ans.end());
			cout<<ans<<endl;
		}
		//cout<<ans.size()<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
	int n,i,j,k,s,t,u;
	int carry = 0;
	string a, b,d;
	vector<int> c;
	cin >> n;
	for (i = 0; i < n; i++) {
		c.clear();
		cin >> a;
		cin >> b;
		while (a.size() > b.size()) {
			b = "0" + b;
		}
		while (b.size() > a.size()) {
			a = "0" + a;
		}
		s = a.size();
		for (j = s-1; j >=0; j--) {
			t = a[j]-'0' + b[j]-'0';
			if (carry == 1) {
				carry = 0;
				t += 1;
			}
			while (t >= 10) {
				t -= 10;
				carry += 1;
			}
			c.push_back(t);
		}
		while (carry == 1) {
			carry = 0;
			c.push_back(1);
		}
		u = c.size();
		if (u > 80||a.size()>80||b.size()>80) {
			cout << "overflow" << endl;
		}
		else if(u<=80){
			for (k = u - 1; k >= 0; k--) {
				cout << c[k];
			}
			cout << endl;
		}
	}
	return 0;
}

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

using namespace std;

class longint
{
// friend
	friend ostream& operator<< (ostream&, const longint&);
	friend istream& operator>> (istream&, longint&);

// variable
private:
	string m_data;

// structor

public:
	longint(const string& data = "0") :
		m_data(data)
	{

	}

// operator
public:
	longint operator+(const longint& rhs) const
	{
		string data1 = m_data;
		string data2 = rhs.m_data;
		reverse(data1.begin(), data1.end());
		reverse(data2.begin(), data2.end());

		string result;
		int carry = 0;
		for(unsigned int i = 0; i < data1.length() || i < data2.length(); i++)
		{
			int num1 = 0;
			int num2 = 0;
			if(i < data1.length())
				num1 = ctoi( data1[i] );
			if(i < data2.length())
				num2 = ctoi( data2[i] );

			int sum = num1 + num2 + carry;
			result.push_back( itoc( sum % 10) );
			carry = sum / 10;
		}

		reverse(result.begin(), result.end());
		return longint(result);
	}

// method
private:
	inline static int ctoi(char c)
	{
		if(c < '0' || '9' < c)
			throw exception();

		return c - '0';
	}

	inline static char itoc(int i)
	{
		if(i < 0 || 9 < i)
			throw exception();

		return '0' + i;
	}
};

ostream& operator<< (ostream& stream, const longint& rhs)
{
	stream << rhs.m_data;
	return stream;
}

istream& operator>> (istream& stream, longint& rhs)
{
	stream >> rhs.m_data;
	return stream;
}

int main()
{
	longint result;

	int n;
	cin >> n;
	while(n-- > 0)
	{
		longint input;
		cin >> input;
		result = result + input;
	}

	cout << result << endl;

	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include<string.h>
#include <utility>
using namespace std;
using namespace std;
int main(){
	int m;
	string in,in2;
	int a[90],b[90],ans[90];
	int f;
	int alen,blen,mlen;
	cin>>m;
	while(m--){
		for(int i=0;i<90;i++){
			a[i]=b[i]=ans[i]=0;
		}
		cin>>in;
		cin>>in2;
		alen=in.size();
		blen=in2.size();
		for(int i=0;i<alen;i++){
			a[alen-1-i]=in[i]-'0';
		}
		for(int i=0;i<blen;i++){
			b[blen-1-i]=in[i]-'0';
		}
		mlen=max(alen,blen);
		if(mlen>80){
			cout<<"overflow"<<endl;
			continue;
		}
		f=0;
		for(int i=0;i<mlen+1;i++){
			ans[i]=(a[i]+b[i]+f)%10;
			f=(a[i]+b[i]+f)/10;
		}
		if(ans[mlen]!=0){
			//if(mlen>79){
				//cout<<"overflow"<<endl;
				continue;
			//}
			//cout<<ans[mlen];
		}
		
		for(int i=0;i<mlen;i++){
			//cout<<ans[mlen-1-i];
		}cout<<endl;
		
		
	}
	return 0;
}