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 <bits/stdc++.h>
using namespace std;

int main(){
  int N; cin >> N;

  for(int i=0; i<N; i++){
    string S1, S2;
    cin >> S1 >> S2;
    int l1 = S1.length(), l2 = S2.length();

    string S; int carry = 0;
    for(int i=0; i<max(l1, l2)+1; i++){
      if(i < l1 && i < l2){
        int s1 = S1[l1-1-i] - '0', s2 = S2[l2-1-i] - '0';
        char a = (s1+s2+carry) % 10 + '0';
        S.push_back(a);
        if(s1+s2+carry >= 10) carry = 1;
        else carry = 0;
      } else if (i == max(l1, l2)){
        if(carry == 1) S.push_back('1');
      } else if (i >= l1){
        int s2 = S2[l2-1-i] - '0';
        char a = (s2+carry) % 10 + '0';
        S.push_back(a);
        if(s2+carry >= 10) carry = 1;
        else carry = 0;
      } else if(i >= l2){
        int s1 = S1[l1-1-i] - '0';
        char a = (s1+carry) % 10 + '0';
        S.push_back(a);
        if(s1+carry >= 10) carry = 1;
        else carry = 0;
      }
    }
    reverse(S.begin(), S.end());

    if(S.length()>80){
      cout << "overflow" << endl;
    } else {
      cout << S << endl;
    }
  }
}

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

int main(){
    
    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] = t%10 + '0';
            t /=10;
        }
        if(cp>0) printf(&c[cp]);
        else printf("overflow");
        printf("\n");
    }
    
    return 0;
    
}

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

string sum( string sa, string sb ){
    string ret = "0";
    int len = max( sa.size(), sb.size() );
    reverse( sa.begin(), sa.end() );
    reverse( sb.begin(), sb.end() );
    while( sa.size()<len )  sa += '0';
    while( sb.size()<len )  sb += '0';
    for( int i=0; i<len; i++ ){
        ret[i] += sa[i]-'0' + sb[i]-'0';
        if( ret[i] > '9' ){
            ret += '1';
            ret[i] -= 10;
        }else if( i!=len-1 ){
            ret += '0';
        }
    }
    reverse( ret.begin(), ret.end() );
    if( ret.size() > 80 ){
        ret = "overflow";
    }
    return ret;
}

int main(){
    int n;
    cin >> n;
    while(n--){
        string a, b;
        cin >> a >> b;
        cout << sum(a, b) << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	string a,b,c;
	int n;
	cin>>n;
	for(int fjal=0;fjal<n;fjal++){
	cin>>a>>b;
	c.clear();
	if(a.size()<b.size())swap(a,b);
	int as=a.size();
	while(as!=b.size())b="0"+b;
	//cout<<a<<" "<<b;
	bool kuri=false;
	for(int i=as-1;i>=0;i--){
		int _a=a[i]-'0',_b=b[i]-'0',ans=_a+_b;
		if(kuri)ans++;
		if(ans>=10){
			kuri=true;
			ans-=10;
		}
		else {kuri=false;}
		c.push_back(ans+'0');
	}
		if(kuri)c.push_back('1');
	
		if(c.size()<80){for(int i=c.size()-1;i>=0;i--)cout<<c[i]-'0';
		cout<<endl;
		}
		else cout<<"overfllow"<<endl;
	}
	return 0;
}

C++: //#define _USE_MATH_DEFINES
#include <iostream>
//#include <stdio.h>
//#include <iomanip>
#include <vector>
#include <string>
//#include <algorithm>
//#include <functional>
//#include <cmath>
//#include <time.h>

using namespace std;


int main(){

	int n, k1, k2, left, right, buf, flag;
	string s1, s2 , out;
	int aa1[10], aa2[10], ans[10];



	cin >> n;

	for (int i = 0; i < n; i++){
		for (int i = 0; i < 10; i++){
			aa1[i] = 0;
			aa2[i] = 0;
			ans[i] = 0;
		}
		flag = 0;

		cin >> s1 >> s2;
		k1 = s1.size();
		k2 = s2.size();

		if (k1 > 80 || k2 > 80){
			cout << "overflow" << endl;
		}
		else{
			buf = 8 - k1 % 8;
			for(int i = 0; i < buf; i++){
				s1.insert(0,"0");
			}
			buf = 8 - k2 % 8;
			for (int i = 0; i < buf; i++){
				s2.insert(0, "0");
			}
			left = s1.size()-8;
			for (int i = 0; i < 10; i++){
				aa1[i] = atoi(s1.substr(left, 8).c_str());
				left -= 8;
				if (left < 0)break;
			}
			left = s2.size() - 8;
			for (int i = 0; i < 10; i++){
				aa2[i] = atoi(s2.substr(left, 8).c_str());
				left -= 8;
				if (left < 0)break;
			}

			for (int i = 0; i < 10; i++){
				ans[i] += aa1[i] + aa2[i];
				if (ans[i] >= 100000000){
					ans[i + 1] += 1;
					ans[i] -= 100000000;
				}
			}
			if (ans[10] >= 100000000){
				cout << "overflow" << endl;
			}
			else{
				for (int i = 9; i >= 0; i--){
					if (flag == 0){
						if (ans[i] != 0){
							printf("%d",ans[i]);
							flag = 1;
						}
					}
					else{
						printf("%08d", ans[i]);
					}
				}
				cout << endl;
			}
		}

	}
	
	return 0;
}

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int n;
	cin >> n;
	
	while(n-- > 0){
	
	string str1;
	cin >> str1;
	
	string str2;
	cin >> str2;
	
	reverse(str1.begin(), str1.end());
	reverse(str2.begin(), str2.end());
	
	int check;
	if(str1.size() > str2.size()){
		check = 1;
	}
	else if(str1.size() == str2.size()){
		check = 2;
	}
	else {
		check = 3;
	}
	
	int ans[100];
	bool next = false;
	int short_ = min(str1.size(), str2.size());
	int long_ = max(str1.size(), str2.size());	
	if(long_ > 80){
		cout << "overflow" << endl;
		continue;
	}

	for(int i = 0; i < short_; ++i){
		int num = 0;
		num += (str1[i] - '0') + (str2[i] - '0');
		if(next){
			num++;
		}
		ans[i] = num;
		next = false;	
		if(num >= 10){
			num -= 10;
			ans[i] -= 10;
			next = true;
		}
		//cout << num << endl;
	}
	/*for(int i = 0; i < min(str1.size(), str2.size()); ++i){
		cout << ans[i];
	}
	cout << endl;*/
	
	if(check == 1){
		for(int i = str2.size(); i < str1.size(); ++i){
			int num = str1[i] - '0';
			if(next){
				num++;
			}
			ans[i] = num;
			next = false;	
			if(num >= 10){
				num -= 10;
				ans[i] -= 10;
				next = true;
			}
		}
		if(next){
			ans[str1.size()] = 1;
			long_ ++;
		}
	}	
	
	if(check == 3){
		for(int i = str1.size(); i < str2.size(); ++i){
			int num = str2[i] - '0';
			if(next){
				num++;
			}
			ans[i] = num;
			next = false;	
			if(num >= 10){
				num -= 10;
				ans[i] -= 10;
				next = true;
			}
		}
		if(next){
			ans[str2.size()] = 1;
			long_ ++;
		}
	}
	
	if(long_ > 80){
		cout << "overflow" << endl;
		continue;
	}

	for(int i = long_ - 1; i >= 0; --i){
		cout << ans[i];
	}/*
	for(int i = 0; i < min(str1.size(), str2.size()) + 1; ++i){
		cout << ans[i];
	}*/

	cout << endl;
	//reverse(ans.begin(), ans.end());
	//cout << ans << endl;
	}
		
	return 0;
}