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>
using namespace std;

string findSum(string str1, string str2)
{
    if (str1.length() > str2.length())
        swap(str1, str2);

    string str = "";

    int n1 = str1.length(), n2 = str2.length();
    int diff = n2 - n1;

    int carry = 0;

    for (int i = n1 - 1; i >= 0; i--)
    {
        int sum = ((str1[i] - '0') +
                   (str2[i + diff] - '0') +
                   carry);
        str.push_back(sum % 10 + '0');
        carry = sum / 10;
    }

    for (int i = n2 - n1 - 1; i >= 0; i--)
    {
        int sum = ((str2[i] - '0') + carry);
        str.push_back(sum % 10 + '0');
        carry = sum / 10;
    }

    if (carry)
        str.push_back(carry + '0');

    string s_str = "";
    for (int i = str.length() - 1; i >= 0; i--)
    {
        s_str.push_back(str[i]);
        str[i] = '\0';
    }

    return s_str;
}

int main(void)
{
    int n;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        string a, b;
        cin >> a >> b;
        if (80 < a.length() || 80 < b.length())
        {
            cout << "overflow" << endl;
        }
        else
        {

            string s = findSum(a, b);
            if (80 < s.length())
            {
                cout << "overflow" << endl;
            }
            else
            {
                cout << s << endl;
            }
        }
    }
    return 0;
}

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

using namespace std;

int main(){
    string a, b;
    vector<int> ans;

    int n, num, ai, bi, c = 0;

    bool flag;

    cin >> n;
    while (n--){
	cin >> a >> b;
	flag = false;

	for (int j = 0; j < 100; j++){
	    num = 0;
	    ai = a.size() - j - 1;
	    bi = b.size() - j - 1;
	    if (ai < 0 && bi < 0 && c == 0) break;

	    if (ai >= 0) num += a[ai] - 48;
	    if (bi >= 0) num += b[bi] - 48;
	    ans.push_back((num+c) % 10);
	    if (num + c >= 10) c = 1;
	    else c = 0;
	}
	if (ans.size() > 80) flag = true;

	if (flag) puts("overflow");
	else {
	    for (int j = ans.size() - 1; j >= 0; --j) printf("%d\n", ans[j]);
	}
	ans.clear();
    }
    return 0;
}

C++: #include <iterator>
#include <typeinfo>
#include <list>
#include <map>     
#include <numeric>
#include <utility>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <iostream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define rep(a,t) for(int a=0;a<t;++a) 
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
#define pb push_back
#define int_maxvalue numeric_limits<int>::max()
ll mod = 1e9 + 7;
string Addition(string a,string b) {
	string ans = "";
	int bef = 0;
	int be1 = 0;
	for (int i = a.length() - 1; i >= 0; i--) {
		int added = stoi(a.substr(i, 1)) + stoi(b.substr(i, 1))+be1;

		if (added >= 10) {
			bef = 1;
			added -= 10;
		}
		else {
			bef = 0;
		}

		ans = to_string(added)+ans;
		/*/
		stringstream ss;
		ss << added;

		ans = ss.str() + ans;*/
		be1 = bef;
		if (i == 0)
		{
			break;
		}
	}
	if (be1 == 1) {
		ans = "1" + ans;
	}
	return ans;
}
int main() {
	int n;
	cin >> n;
	rep(o1, n) {
		string a, b;
		cin >> a >> b;
		if (a.length() < b.length()) {
			swap(a, b);
		}
		string b1 = b;
		for (int i = 0; i < a.length() - b1.length(); ++i) {
			b = '0' + b;
		}
		string ans = Addition(a, b);
		if (ans.length() > 80) { cout << "overflow" << endl; }
		else {
			cout << ans << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  int n;
  cin >> n;
  for(int i = 0;i < n;i++){
    string a,b,c; char tmp;
    cin >> a >> b;
    if(a.size() > 80 || b.size() > 80){
      cout << "overflow" << endl;
      continue;
    }
    if(a.size() < b.size()){swap(a,b);}
    for(int k = 0;k< a.size();k++)
      c[k] = '0';
     for(int k = 0;k < b.size();k++){
       c[k] = b[b.size()-1-k];
     }
     b.resize(a.size());
     for(int k = 0;k < a.size();k++)
       {b[k] = c[k]; c[k] = a[k];} 
     for(int k = 0;k < a.size();k++){
      	a[a.size()-k-1] = c[k];
     }
	
     tmp = '0';
     for(int k = 0;k < a.size();k++){
       c[k] = a[k] + b[k] + tmp -'0' -'0';
	  if(c[k] > '9'){ tmp = '1'; c[k] = c[k] - ':' + '0'; }
	  else {tmp = '0';}
     } 
     if(a.size() <= 79 ){if(tmp == '1'){ cout << tmp;}
       for(int k = a.size()-1;k >=0;k--){
	 cout << c[k]; 
	  }
       cout << endl;
     } else {cout <<"overflow"<<endl; } 
     
  }
}

C++: 

int main(){
    int n;
    cin>>n;
    
    rep(j,n){
        int x[100]={},y[100]={};
        string a,b;
        cin>>a>>b;
        if(a.size()>80 || b.size()>80){cout<<"overflow"<<endl;return 0;}
        else{
        for(int i=a.size()-1;i>=0;i--){
            x[a.size()-1-i]=a[i]-'0';
        }
        for(int i=b.size()-1;i>=0;i--){
            y[b.size()-1-i]=b[i]-'0';
        }
        int ans[100]={};
        for(int i=0;i<80;i++){
            
            ans[i]+=x[i]+y[i];
            ans[i+1]+=ans[i]/10;
            ans[i]-=ans[i]/10*10;
        }
        if(ans[80]!=0)cout<<"overflow"<<endl;
        else{
            bool flag=false;
            for(int i=79;i>=0;i--){
                if(ans[i]!=0)flag=true;
                if(flag||i==0)cout<<ans[i];
            }
        }
        cout<<endl;
        }
    }
    return 0;
}

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

string strplus(string x,string y){
  if(x.size()>80||y.size()>80)return "overflow";
  string ans="";
  int xa[80],ya[80],za[80];
  for(int i=0;i<80;i++)xa[i]=ya[i]=za[i]=0;
  for(int i=0;i<(int)x.size();i++)xa[i]=x[x.size()-1-i]-'0';
  for(int i=0;i<(int)y.size();i++)ya[i]=y[y.size()-1-i]-'0';
  for(int i=0;i<80;i++){
    za[i]+=xa[i]+ya[i];
    if(za[i]>=10){
      if(i==79)return "overflow";
      else za[i+1]++;
    }
    za[i]%=10;
  }
  int flg=0;
  for(int i=79;i>=0;i--){
    if(flg==0&&za[i]==0)continue;
    else{
      flg=1;
      ans+=(za[i]+'0');
    }
  }
  return ans;
}
int main(){
  int n;
  string a,b;
  cin>>n;
  while(n--){
    cin>>a>>b;
    cout<<strplus(a,b)<<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
    int n,k=0;
    for(cin>>n;n--;){
        string a,b;
        cin >> a;
        cin >> b;
        if(a.size() < b.size()) swap(a,b);//????????????a>b?????????
        while(b.size() < a.size()) b = '0' + b;//????????????a==b?????????
        for(int i=a.size()-1;i>=0;i--){//???????????????????????????
            a[i] += b[i] - '0' + k;
            if(a[i] > '9'){
                a[i]-=10;
                k = 1;
            }
            else k = 0;
        }
        if(k)   a="1"+a;//??°??????????????????????????????????¶?????????¨???
        if(a.size() > 80)   cout << "overflow" << endl;
        else    cout << a << endl;
    }
    return 0;
}