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 <math.h>
#include <algorithm>
using namespace std;
int main(){
	int N;
	string x, y, temp;
	int i, a[80];
	

	cin >> N;

	for(i = 0;i < 80;i++){
		a[i] = 0;
	}

	while(N != 0){
		bool over = false;
		if(N == 0) break;
		cin >> x >> y;
		N--;
		if(x.size() > 80 || y.size() > 80){
			cout << "overflow" << endl;
			continue;
		}

		if(x == "0" && y == "0"){
			cout << "0" << endl;
			continue;
		}

		if(x.size() < y.size()){
			temp = x;
			x = y;
			y = temp;
		}
		int xi = 0, yi = 0;
		for(i = 0;i < x.size();i++){
			xi = x[x.size() - 1 - i] - '0';
			//cout << "xi = " << xi << endl;
			if(i >= y.size()){
				yi = 0;
			}
			else {
				yi = y[y.size() - 1 - i] - '0';
				//cout << "yi = " << yi << endl;
			}
			a[i] += xi + yi;
			//cout << "xi + yi  = " << a[x.size() - 1 - i] << endl;
			if(a[i] > 9){
				if(i < 79){
					a[i] = a[i] - 10;
					a[i + 1] += 1;
				}
				else if(i >= 79){
					cout << "overflow"	<< endl;
					over = true;
					break;				
				}
			}

			
		}
		 
		if(!over){
			bool start = false;
			for(i = 79;i >= 0;i--){
				if(!start && a[i] > 0){
					start = true;
				}
				if(start){
					cout << a[i];
				}
			}
			cout << endl;
		}
		
		for(i = 0;i < 80;i++){
				a[i] = 0;
		}
		
	}
	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){
      za[i]-=10;
      if(i==79)return "overflow";
      else za[i+1]++;
    }
  }
  int flg=0;
  for(int i=79;i>=0;i--){
    if(flg==0&&za[i]==0)continue;
    else{
      flg=1;
      ans+=(za[i]+'0');
    }
  }
  if(ans=="")return "0";
  else 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>
#include<cmath>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int stoi(string s){
  int size=s.size();
  int num=0;
  rep(i,size){
    num+=((int)s[i]-'0')*pow(10,size-i-1);
  }
  return num;
}

string itos(int num){//this function is used when you want to change variable type from int to string
  int size=0;
  int cnt=1;
  while(num/cnt!=0){//count the digit of num
    size++;
    cnt*=10;
  }
  string s="";
  rep(i,size){//change num from int to string
    s+=(char)((num/(int)pow(10,size-i-1))+'0');
    num-=(int)(num/pow(10,size-i-1))*pow(10,size-i-1);
  }
  return s;
}

int main(){
	int n;
	cin>>n;
	string s[2];
	rep(i,n){
		cin>>s[0]>>s[1];
		if(s[0].size()>=80 || s[1].size()>=80){
			cout<<"overflow"<<endl;
			continue;
		}
		int dis=abs(s[0].size()-s[1].size());
		if(s[0].size()>s[1].size()){
			rep(j,dis){
				s[1].insert(0,"0");
			}
		}else{
			rep(j,dis){
				s[0].insert(0,"0");
			}
		}
		int size=s[0].size();
		int alt=0;
		string ans="";
		int num1;
		int num2;
		for(int a=(size-1);a>=0;a--){
			num1=(int)s[0][a]-'0';
			num2=(int)s[1][a]-'0';
			int result=num1+num2+alt;
			if(result<10){
				if(!result)ans.insert(0,"0");
				else ans.insert(0,itos(result));
				alt=0;
			}else{
				if(!(result%10))ans.insert(0,"0");
				else ans.insert(0,itos(result%10));
				alt=1;
			}
		}
		if(alt)ans.insert(0,"1");
		if(ans.size()>=80)ans="overflow";
		else{
			while(ans[0]=='0'){
				ans.erase(ans.begin());
			}
			if(ans.size()==0)ans="0";
		}
		cout<<ans<<endl;
	}
	return 0;
}

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

using namespace std;

int main (void) {
    int N;
    cin >> N;
    while (N--) {
        string s1, s2;
        cin >> s1;
        cin >> s2;
        vector<int> n1, n2, res;
        for (int i = s1.size(); i--;) {
            n1.push_back((int)(s1[i] - '0'));
        }
        for (int i = s2.size(); i--;) {
            n2.push_back((int)(s2[i] - '0'));
        }
        if (n1.size() < n2.size()) {
            for (int i = n1.size(); i < n2.size(); i++) {
                n1.push_back(0);
            }
        } else if (n2.size() < n1.size()) {
            for (int i = n2.size(); i < n1.size(); i++) {
                n2.push_back(0);
            }
        }
        int s, c = 0;
        for (int i = 0; i < n1.size(); i++) {
            s = n1[i] + n2[i] + c;
            res.push_back(s % 10);
            c = s / 10;
        }
        if (c != 0) {
            res.push_back(c);
        }
        if (res.size() > 80) {
            cout << "overflow" << endl;
        } else {
            int i = res.size();
            while (res[i - 1] == 0) {
                i--;
            }
            while (i--) {
                cout << res[i];
            }
            cout << endl;
        }
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

string solve(string s1, string s2){
while(s1.size()<85){
s1 = '0' + s1;
}
while(s2.size()<85){
s2 = '0' + s2;
}
string ret = "";
int kuri = 0;
for(int i=0;i<80;i++){
int r = (int)(s1[s1.size()-1-i]-'0') + (int)(s2[s2.size()-1-i]-'0') + kuri;
kuri = r/10;
r = r%10;
ret = ((char)('0'+r)) + ret;
}
if (kuri>0) return "overflow";
else{
string ret2 = "0";
for(int i=0;i<ret.size();i++){
if (ret[i]!='0'){ret2 = ret.substr(i);break;}
}
return ret2;
}
}

int main(void){
int N;
cin >> N;
for(int i=0;i<N;i++){
string s1, s2;
cin >> s1;
cin >> s2;
cout << solve(s1, s2) << endl;
}
return 0;
}

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

int main() {
	int n;cin>>n;
	string a,b;for(int j=0;j<n;j++){
	cin>>a>>b;
	int d=0;
	if(a.length()<b.length())
	{
		int aa=a.length();
		for(int i=0;i<b.length()-aa;i++)a='0'+a;
	}
	else
	{
		int bb=b.length();
		for(int i=0;i<a.length()-bb;i++)b='0'+b;
	}
	string ans="";
	for(int i=a.length()-1;i>=0;i--)
	{
		int aa=a[i]-'0';
		int bb=b[i]-'0';
		ans=char((aa+bb+d)%10+'0')+ans;
		d=(aa+bb+d)/10;
	}
	if(d)ans=char(d+'0')+ans;
	if(ans.length()>=80)cout<<"overflow"<<endl;
	else cout<<ans<<endl;}
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	int n;
	cin >>n;
	while(n--){
		string a, b, c;
		cin >>a>>b;
		int x = a.size(), y = b.size(), t = 0, max = (x>y)?x:y;
		for(int i=0; i<max; i++){
			if(i<x && i<y){t = (int)a[x-i-1]+(int)b[y-i-1]-2*'0'+t/10;}
			else if(i<x){t = (int)a[x-i-1]-'0'+t/10;}
			else if(i<y){t = (int)b[y-i-1]-'0'+t/10;}
			c+=(char)(t%10)+'0';
		}
		if(t/10){c+='1';}
		if(c.size() > 80){cout<<"overflow";}
		else{for(int i=c.size()-1; i>=0; i--){cout<<c[i];}}
		cout<<endl;
	}
	return 0;
}