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

using namespace std;

int main(){
	int n;
	string ret1,ret2;
	vector<int> result;
	int num = 0, ret = 0;
	int j;

	cin >> n;

	for (int i = 0;i < n;i++){

		cin >> ret1 >> ret2;

		if (ret1.size() > 80 || ret2.size() > 80){
			cout << "overflow" << endl;
		}

		for (j = 1;j <= ret1.size() && j <= ret2.size();j++){
			num = (ret1.at(ret1.size() - j) - '0' + ret2.at(ret2.size() - j) - '0' + ret) % 10;
			ret = (ret1.at(ret1.size() - j) - '0' + ret2.at(ret2.size() - j) - '0' + ret);
			ret = (int)log10((double)ret);
			result.push_back(num);
		}

		if (ret1.size() == ret2.size()){
			if (ret != 0)
				result.push_back(ret);
		}
		else if(ret1.size() > ret2.size()){
			for (; j <= ret1.size(); j++){
				num = (ret1.at(ret1.size() - j) - '0' + ret) % 10;
				ret = ret1.at(ret1.size() - j) - '0' + ret;
				ret = (int)log10((double)ret);
				result.push_back(num);
			}
			if (ret != 0)
				result.push_back(ret);
		}
		else if (ret1.size() < ret2.size()){
			for (; j <= ret2.size(); j++){
				num = (ret2.at(ret2.size() - j) - '0' + ret) % 10;
				ret = ret2.at(ret2.size() - j) - '0' + ret;
				ret = (int)log10((double)ret);
				result.push_back(num);
			}
			if (ret != 0)
				result.push_back(ret);
		}


		while (result.empty() != true){
			cout << result[result.size()-1];
			result.pop_back();
		}
                cout << endl;

	}


	return 0;
}

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

int main() {
  
  int n,i,j;
  cin >> n;

  for(i=0;i<n;i++){
    string str1,str2,temp;
    int kuriagari=0;
    cin >> str1 >> str2;
    
    if (str1.size()<str2.size()){
      temp = str1;
      str1 = str2;
      str2 = temp;
    }
    int goukei[str1.size()+1];
    
    for(j=0;j<str1.size()+1;j++){
      
      if (j==str1.size()){
	goukei[0] = kuriagari;
      }else if (j<str2.size()){
	goukei[str1.size()-j] = str2[str2.size()-1-j] + str1[str1.size()-1-j] + kuriagari -'0' - '0';
	if (goukei[str1.size()-j] >= 10) {
	  goukei[str1.size()-j] -= 10;
	  kuriagari = 1;
	}else{
	  kuriagari = 0;
	}
      }else{
	goukei[str1.size()-j] = str1[str1.size()-1-j] + kuriagari -'0';
	if (goukei[str1.size()-j] >= 10) {
	  goukei[str1.size()-j] -= 10;
	  kuriagari = 1;
	}else{
	  kuriagari = 0;
	}
      }
    }
    if ((str1.size()>=81)||( (str1.size()==80)&&(goukei[0]==1) )){
      cout << "overflow" <<endl;
    }else{
      if (goukei[0]!=0)
	cout << goukei[0] ;
      for(j=0;j<str1.size();j++)
	cout << goukei[j+1];
      cout <<endl;
    }
  }
      
  return 0;
  
}

C++: #include <stdio.h>
#include <string.h>

int main(void)
{
  int N;
  scanf("%d", &N);

  int i,j,k;
  for(i=0; i<N; ++i){

    int digits[2][80];
    for(j=0; j<2; ++j){
      for(k=0; k<80; ++k){
        digits[j][k] = 0;
      }
    }

    int overflow = 0; 

    for(j=0; j<2; ++j){
      char digit[256];
      scanf("%s", digit);
      getchar();
      
      if(overflow || strlen(digit)>80){
        overflow = 1;
      }else{
        for(k=0; k<strlen(digit); ++k){
          digits[j][k] = digit[strlen(digit)-1-k]-'0';
        }
      }
    }

    if(!overflow){
      int sum[81];
      for(j=0; j<81; ++j){
        sum[j] = 0;
      }

      for(j=0; j<80; ++j){
        for(k=0; k<2; ++k){
          sum[j] += digits[k][j];
        }
        sum[j+1] += sum[j]/10;
        sum[j] %= 10;
      }

      if(sum[80]>0){
        overflow = 1;
      }else{
        int available = 0;
        for(j=80; j>=0; --j){
          if(available || sum[j]!=0 || j==0){
            available = 1;
            printf("%d", sum[j]);
          }
        }
        printf("\n");
      }
    }

    if(overflow){
      printf("overflow\n");
    }
  }

  return 0;
}

C++: #include <cstdio>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
#define ALL(v) v.begin(), v.end()

string calc(string a, string b);

int main()
{
	int n;
	string a,b;
	scanf("%d", &n);
	
	while(n--){
		cin >> a >> b;
		cout << calc(a,b) << endl;
	}
	return(0);
}

string calc(string a, string b)
{
	reverse(ALL(a));
	reverse(ALL(b));
	
	while(a.size() < b.size()) a += '0';
	while(b.size() < a.size()) b += '0';
	
	int c = 0;
	string res;
	
	for(int i = 0; i < a.size(); i++){
		c = c+a[i] - '0' + b[i] - '0';
		res += c%10 + '0';
		c /= 10;
	}
	if(c)res += c + '0';
	if(res.size() > 80) return "overflow";
	reverse(ALL(res));
	return res;
}

C++: #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

int c[100];

void add(char*a, char*b)  //鮟倩ョ、a豈巴髟ソ
{
    fill(c,c+100,0);      //蜥檎噪蜷?ス咲スョ髮カ
    int la=strlen(a), lb=strlen(b);
    int i,j;
    for( i=la,j=lb;i>la-lb&&j>0;i--,j--) // 菫晉蕗c豈泌刈謨ー譛?柄荳イ螟壻ク?ス?    {
            c[i]+=a[i-1]-'0'+b[j-1]-'0';
            if(c[i]>9)
            {
                c[i]-=10;
                c[i-1]++;
            }
    }
        for( i=la-lb;i>0;i--)
        {
            c[i]+=a[i-1]-'0';
            if(c[i]>9)
            {
                c[i]-=10;
                c[i-1]++;
            }
        }
        
        if(la==80&&c[0]==1) printf("overflow\n");
        else
        {
            if(c[0]==0)
            {
                for( i=1;i<=la;i++)
                    printf("%d",c[i]);
                printf("\n");
            }
            else
            {
                for( i=0;i<=la;i++)
                   printf("%d",c[i]);
                printf("\n");
            }
        }
}

int main()
{
    char a[100], b[100];
    int n;
    scanf("%d",&n);

    while(n--){
    scanf("%s%s",a,b);
    int la = strlen(a), lb = strlen(b);
    if(la>80 || lb>80)
        printf("overflow\n");
    else if(la>lb)
        add(a,b);
    else add(b,a);
    }
    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

string sumString(string a, string b) {
  if (a.size() > b.size()) swap(a, b);
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  for (int i = 0; i < a.size(); i++) {
    if (a[i] + b[i] - 2 * '0' < 10) {
      b[i] += a[i] - '0';
    } else {
      b[i] = (a[i] + b[i] - 2 * '0') % 10 + '0';
      int j = i + 1;
      while (j < b.size() && b[j] == '9') {
        b[j++] = '0';
      }
      if (j == b.size()) b += "1";
      else b[j] += 1;
    }
  }
  reverse(b.begin(), b.end());
  return b;
}

int main(void) {
  int n;
  cin >> n;

  for (int i = 0; i < n; i++) {
    string a, b;
    cin >> a >> b;

    string ans = sumString(a, b);
    cout << (ans.size() <= 80 ? ans : "overflow") << endl;
  }

  return 0;
}

C++: #include<iostream>
#include<string>
typedef unsigned int u;
using namespace std;
typedef string::iterator s;
u z=100000000;
void p(u*a,u*l,u n){
	if(a-l)
	p(a+1,l,(n+=*a*10)/z),
	*a=n%z;	
}
u t(u*a,u*l){
	u r=0;
	char b[11]={};
	if(a-l)
	if(!t(a+1,l)){
		if(*a)cout<<*a,r=1;
	}else
		sprintf(b,"%d",*a+z),
		cout<<b+1,
		r=1;
	return r;
}
void d(u*a,u*l,u*b,u n=0){
	if(a-l)
	d(a+1,l,b+1,(n+=(*a+*b))/z),
	*a=n%z;
}
u main(){
	u n;
	cin>>n;
	string a,b;
	getline(cin,a);
	for(;n--;){
		getline(cin,a);
		getline(cin,b);
		u x[11]={},y[11]={},c=0;
		for(s i=a.begin();i!=a.end();p(x,x+10,*i++-48))
			if(++c>80)goto g;
		c=0;
		for(s i=b.begin();i!=b.end();p(y,y+10,*i++-48))
			if(++c>80)goto g;
		d(x,x+11,y);
		if(x[10])goto g;
		else if(!t(x,x+10))cout<<'0';
		if(0)
g:
		cout<<"overflow";
		cout<<'\n';
	}
}