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

int main(){

	int n;

	string a, b;
	char N1[80], N2[80];
	char sum[80];

	cin >> n;

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

		cin >> a;
		
		if( a.length() >= 80 ){
			cout << "overflow" << endl;
			continue;
		}

		cin >> b;

		if( b.length() >= 80 ){
			cout << "overflow" << endl;
			continue;
		}

		for( int i=0;i<80;i++ ){
			N1[i] = -1; N2[i] = -1; sum[i] = 0;
		}

		for( int i=1;i<=a.length();i++ )
			N1[i] = a[a.length()-i] - '0';
		for( int i=1;i<=b.length();i++)
			N2[i] = b[b.length()-i] - '0';

		int over = 0;
		
		for( int i=0;i<80;i++ ){


			if( N1[i] == -1 && N2[i] == -1 ){
				if( over >= 10 ){
					sum[i] = over / 10;
					over = 0;
				}else
					sum[i] = -1;
				continue;
			}

			if( N1[i] != -1 )
				sum[i] += N1[i];
			if( N2[i] != -1 )
				sum[i] += N2[i];

			sum[i] += over / 10;

			over = floor((double)sum[i]/10)*10;

			sum[i] -= over;
			
		}

		if(over > 0)cout << "overflow" << endl;
		else{		
			for( int i=1;i<=80;i++ ){
				if( sum[80-i] >= 0 )
					cout << (int)sum[80-i];
			}
			cout << endl;
		}


	}
	return 0;
}

C++: #include<stdio.h>
#include<math.h>
#include<algorithm>
#include<string.h>
using namespace std;
char s[100],t[100];
int a[100],b[100],c[110];
int main()
{
    int T,d=0;
    int n=1;
    scanf("%d%*c",&T);
    while(T--)
    {
        memset(s,0x00,sizeof(s));
        memset(t,0x00,sizeof(t));
        memset(a,0,sizeof(a));
        memset(b,0,sizeof(b));
        memset(c,0,sizeof(c));
        scanf("%s",s);
        scanf("%s",t);
//        if(strlen(s)>80||strlen(t)>=80)
//           {
//               printf("overflow\n");
//        break;
//           }
        int l=0;
        for(int i=strlen(s)-1; i>=0; i--)
            a[l++]=s[i]-'0';
        int k=0;
        for(int i=strlen(t)-1; i>=0; i--)
            b[k++]=t[i]-'0';
        if(l<k)
            l=k;
        int v=0;
        for(int i=0; i<=l; i++)
        {
            if(a[i]+b[i]+v>=10)
            {

                c[i]=a[i]+b[i]+v-10;
                v=1;
            }
            else
            {
                c[i]=a[i]+b[i]+v;
                v=0;
            }
        }
        if(c[l]!=0&&l>=80)
        {
            printf("overflow\n");
            break;
        }
        else if(c[l]==0&&l-1>=80)
        {
            printf("overflow\n");
            break;
        }
        if(c[l]!=0)
            printf("%d",c[l]);
        for(int i=l-1;i>=0;i--)
            printf("%d",c[i]);
        printf("\n");
    }
    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 a_len,b_len,m_len;
	cin>>m;
	while(m--){
		for(int i=0;i<90;i++){
			a[i]=b[i]=ans[i]=0;
		}
		cin>>in;
		cin>>in2;
		a_len=in.size();
		b_len=in2.size();
		for(int i=0;i<a_len;i++){
			a[a_len-1-i]=in[i]-'0';
		}
		for(int i=0;i<b_len;i++){
			b[b_len-1-i]=in[i]-'0';
		}
		m_len=max(a_len,b_len);
		if(m_len>80){
			cout<<"overflow"<<endl;
			continue;
		}
		f=0;
		for(int i=0;i<m_len+1;i++){
			ans[i]=(a[i]+b[i]+f)%10;
			f=(a[i]+b[i]+f)/10;
		}
		//if(ans[m_len]!=0){
			//if(m_len>79){
				//cout<<"overflow"<<endl;
				//continue;
			//}
			cout<<ans[m_len];
		//}
		/*
		for(int i=0;i<m_len;i++){
			cout<<ans[m_len-1-i];
		}cout<<endl;
		
		*/
	}
	return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<string>
using namespace std;
int main(){

int n;
cin>>n;
for(int iii=0;iii<n;iii++){
string st1,st2;
int n1[83]={},n2[83]={};
cin>>st1>>st2;
for(int i=0;i<st1.size();i++)
n1[i]=st1[st1.size()-i-1]-'0';
for(int i=0;i<st2.size();i++)
n2[i]=st2[st2.size()-i-1]-'0';
int N[83]={};int y=0;

int r=st1.size();
if(r<st2.size())r=st2.size();
for(int i=0;i<r;i++){
N[i]=(n1[i]+n2[i]+y)%10;
y=(n1[i]+n2[i]+y)/10;
if(i==r-1&&y>0)r++;
}
if(r>81)cout<<"overflow"<<endl;
else{
for(int i=0;i<r;i++)
cout<<N[r-i-1];
cout<<endl;
}}
return 0;
}

C++: #include <iostream>
#include <cmath>

using namespace std;

int string_to_d(const string &s){
	int num = 0;
	if(!s.empty())
	for(int i=s.size()-1;i>=0;--i){
		if('1'<=s[i]&&s[i]<='9') num += (s[i]-'0')*pow(10,s.size()-i-1);
	}
	return num;
}

int main(void){
	int n;
	while(cin >> n){
		for(int a=0;a<n;++a){
			string s1,s2;
			cin >> s1 >> s2;
			int ex1num[10];//8*10=80桁
			int ex2num[10];
			int sum[10] = {0};
			for(int i=s1.size();i<80;++i) s1="0"+s1;
			for(int i=s2.size();i<80;++i) s2="0"+s2;
			for(int i=0;i<10;++i){
				sum[i] = 0;
				ex1num[i] = string_to_d(s1.substr((10-i-1)*8,8));
				ex2num[i] = string_to_d(s2.substr((10-i-1)*8,8));
			}
			int carry = 0;
			for(int i=0;i<10;++i){
				sum[i] = (ex1num[i]+ex2num[i]+carry)%(int)1e+008;
				carry = floor((ex1num[i]+ex2num[i]+carry)/(int)1e+008);
			}
			if(carry>0){
				cout << "overflow\n";
				continue;
			}
			bool zeroshow = false;
			for(int i=9;0<=i;--i){
				if(zeroshow&&sum[i]!=0) for(int j=0;j<7-(int)log10(sum[i]);j++) cout << "0";
				if(zeroshow&&sum[i]==0) for(int j=0;j<8;j++) cout << "0";
				if(sum[i]!=0) cout << sum[i];
				if(sum[i]>0) zeroshow = true;
			}
			cout << "\n";
		}
	}
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cstring>
#include <functional>

using namespace std;

#define REP(i,a,b) for((i)=(a);(i)<(int)(b);(i)++)
#define rep(i,n) REP(i,0,n)
// BEGIN CUT HERE
#define foreach(itr,c) for(typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
// END CUT HERE

int main(){
  int i, j, n;
  int len1, len2;
  char tmp;

  scanf("%d",&n);
  rep(i,n){
    string str1, str2, res;
    cin >> str1;
    cin >> str2;

    vector<int> a(82, 0), b(82, 0);
    len1 = str1.size(); len2 = str2.size();
    rep(j,len1) a[j] = str1[len1-1-j] - '0';
    rep(j,len2) b[j] = str2[len2-1-j] - '0';

    rep(j,81){
      int sum = a[j] + b[j];
      if(sum >= 10){ sum %= 10; a[j+1]++;}
      res += (sum + '0');
    }

    reverse(res.begin(), res.end());
    int f = 0;
    rep(j,res.size()){
      if(res[j] != '0') f = 1;
      if(f) cout << res[j];
    }

    cout << endl;
  }

  return 0;
}