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 <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(c,itr) 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;

  cin >> n;
  rep(i,n){
    string str1, str2, res;
    cin >> str1;
    cin >> str2;

    vector<int> a(80, 0);
    rep(j,str1.length()) a[j] = str1[str1.length()-1-j] - '0';

    vector<int> b(80, 0);
    rep(j,str2.length()) b[j] = str2[str2.length()-1-j] - '0';

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

    reverse(res.begin(), res.end());
    bool f = false;
    rep(j,res.length()){
      if(res[j] != '0') f = true;
      if(f) printf("%c", res[j]);
    }
  }

  return 0;
}

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

int main(void){

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

	scanf("%d",&N);

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

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

		if(strlen(fi)<=80&&strlen(se)<=80){
		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;
		}
		q=0;
		if(kuri==1) printf("1");q=1;
		if(keta+q<=80){
			for(j=keta-1;j>=0;j--){
				printf("%c",ans[j]);
			}
		}
		else printf("overflow");
		}
		else printf("overflow");
		printf("\n");
	}

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
char str[102],str1[102],ans[102];
int sam(int ma1,int ma2)
{
    int co,carry=0,a,b;
    for(int i=0;ma1-i>=0||ma2-i>=0||carry==1;i++){
            if(ma1-i>=0&&ma2-i>=0){
                    a=str[ma1-i]-'0';
                    b=str1[ma2-i]-'0';
                    if(a+b+carry>=10){
                        ans[i]=a+b+carry-10+'0';
                        carry=1;
                    }
                    else {
                        ans[i]=a+b+carry+'0';
                        carry=0;
                    }
            }
            else if(ma1-i>=0){
                    a=str[ma1-i]-'0';
                    if(a+carry>=10){
                        ans[i]=a+carry-10+'0';
                        carry=1;
                    }
                    else {
                        ans[i]=a+carry+'0';
                        carry=0;
                    }
            }
            else if(ma2-i>=0){
                    b=str1[ma2-i]-'0';
                    if(b+carry>=10){
                        ans[i]=b+carry-10+'0';
                        carry=1;
                    }
                    else {
                        ans[i]=b+carry+'0';
                        carry=0;
                    }
            }
            else {
                ans[i]='0'+1;
                return i;
            }
        co=i;

    }
    return co;

}
int main()
{
    int a,b,n;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>str>>str1;
        a=strlen(str);
        b=strlen(str1);
        a=sam(a,b);
        if(a>80)cout<<"overflow\n";
        else for(int j=a;j>0;j--)cout<<ans[j];
        cout<<endl;
    }

}

C++: #include <iostream>
#include <string>
using namespace std;
int main()
{
	int N; cin >> N ;
	for(int i=0;i<N;i++)
	{
		string str,ptr,temp,ans; cin >> str >> ptr ;
		int lens,lenp,len;
		lens=str.size(); lenp=ptr.size();
		bool flag=false; len=max(lens,lenp);
		temp=str; for(int i=0;i<lens;i++) str[i]=temp[lens-i-1];
		temp=ptr; for(int i=0;i<lenp;i++) ptr[i]=temp[lenp-i-1];
		for(int i=0;i<len;i++)
		{
			int temp;
			if(i>=lens && i<lenp) temp=ptr[i]-'0';
			else if(i<lens && i>=lenp) temp=str[i]-'0';
			else temp=(str[i]-'0')+(ptr[i]-'0'); 
			if(flag==true) temp++,flag=false;
			if(temp>=10) flag=true,temp%=10;
			char ch='0'+temp;
			if(!i) ans=ch;
			else ans+=ch;
		}
		if(flag==true) ans+='1';
		temp=ans; int LEN=ans.size();
		for(int i=0;i<LEN;i++) ans[i]=temp[LEN-i-1];
		if(LEN>80) ans="overflow";
		cout << ans << '\n' ;
	}
}

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
	int n;
	cin >> n;
	while(n--){
		string a, b;
		bool cu = false;
		cin >> a >> b;
		int al = a.length(), bl = b.length(), ans[101] = {0};
		for(int i = 0; i < min(al, bl); i++){
			ans[i] = a[al-i-1] + b[bl-i-1] - 48 * 2;
			if(cu) ans[i]++;
			if(ans[i] >= 10){
				ans[i] %= 10;
				cu = true;
			}else cu = false;
		}
		for(int i = min(al, bl); i < max(al, bl); i++){
			if(al > bl) ans[i] = a[al-i-1] - 48 + cu;
			else ans[i] = b[bl-i-1] - 48 + cu;
			if(ans[i] >= 10){
				ans[i] %= 10;
				cu = true;
			}else cu = false;
		}
		if(cu) ans[max(al, bl)] = 1;
		if(max(al, bl)+cu > 80) cout << "overflow" << endl;
		else for(int i = (cu? max(al, bl):max(al, bl)-1); i >= 0; i--) cout << ans[i];
		cout << endl;
	}
	return 0;
}

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

string Sum(string& FirstInteger, string& SecondInteger)
{
	int Degit;
	string AddedZero;
	if(FirstInteger.size() < SecondInteger.size()){
		Degit = SecondInteger.size();
		for(int i = 0; i < Degit - FirstInteger.size(); i++){
			AddedZero.push_back('0');
		}
		FirstInteger = AddedZero + FirstInteger;
	}else{
		Degit = FirstInteger.size();
		for(int i = 0; i < Degit - SecondInteger.size(); i++){
			AddedZero.push_back('0');
		}
		SecondInteger = AddedZero + SecondInteger;
	}
//	cout << FirstInteger << '+' << endl << SecondInteger << endl;
	string SumInteger;
	SumInteger.resize(Degit);
	bool IsMoveUp  = false;
	bool WasMoveUp = false;
	for(int i = 0; i < Degit; i++){
		WasMoveUp = IsMoveUp;
		int Sum = WasMoveUp + FirstInteger[Degit-1-i] - '0' + SecondInteger[Degit-1-i] - '0';
		if(Sum >= 10){
			IsMoveUp = true;
			Sum -= 10;
		}else{
			IsMoveUp = false;
		}
		SumInteger[Degit-1-i] = Sum + '0';
	}
	if(IsMoveUp == true){
	    return '1' + SumInteger;
	}else{
	    return SumInteger;
	}
}

int main()
{
	int N;
	cin >> N;
	for(int i = 0; i < N; i++){
		string FirstInteger, SecondInteger;
		cin >> FirstInteger >> SecondInteger;
//		cout << FirstInteger << '+' << SecondInteger << endl;
		string SumInteger = Sum(FirstInteger, SecondInteger);
//		cout << SumInteger.size() << "keta" << endl;
		if(SumInteger.size() <= 80){
//		    cout << "c" << endl;
		    cout << SumInteger.c_str() << endl;
//			cout << "b" << endl;
		}else{
			cout << "overflow" << endl;
		}
//		cout << "a" << endl;
	}
	return 0;
}