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<algorithm>
using namespace std;
int main(){

  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    string a,b,out,tmp;
    cin >> a;
    cin >> b;
    //int m=max(a.size(),b.size());
    if(a.size()<b.size()){
      tmp=a;
      a=b;
      b=tmp;
    }
    //cout << a << endl;
    int si=-a.size()+b.size();
    for(int j=a.size()-1;j>=0;j--){
      if(j+si>=0){
	//cout << si << endl;
	a[j]+=b[j+si]-'0';
	//cout << a[j] << endl;
      }else{
	a[j]+=0;
	//cout << "!" << endl;
      }
      if(a[j]>'9'&&j!=0){
	a[j-1]++;
	a[j]-=10;
      }else if(a[j]>'9'&&j==0){
	a='1'+a;
	a[1]-=10;
	//for(int i=a.size();i>0;i--)
	//  a[i]=a[i-1];
	//a[1]-=10;
	//a[0]='1';
      }
    }
    if(a[80]!='\0')
      cout << "overflow" << endl;
    else
      cout << a << endl;
  }

}

C++: #include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
#include <map>
#include <fstream>
#include <array>
#include <utility>
#include <functional>
#include <stack>

using namespace std;
typedef long long Int;
#define REP(i , x) for(Int i = 0 ; i < x ; ++i)

typedef pair<int, int> P;


int main()
{
	int n;
	cin >> n;
	REP(i, n){
		string a, b;
		int a_a[100] = { 0 };
		int b_a[100] = { 0 };
		int c_a[100] = { 0 };
			cin >> a >> b;
			if (a.length() >= 80 || b.length() >= 80){
				cout << "overflow" << endl;
				continue;
			}

			REP(i, a.length()){
				a_a[i] = a[a.length() - i -1] - '0';
			}
			
			REP(i, b.length()){
				b_a[i] = b[b.length() - i -1] - '0';
			}

			REP(i, 84){
				int temp = a_a[i] + b_a[i] + c_a[i];
				c_a[i + 1] += temp / 10;
				c_a[i] = temp % 10;
			}

			int i = 84;

			while (!c_a[i] && i){
				--i;
			}
			if (i >= 80){
				cout << "overflow" << endl;
				continue;
			}

			while (i >= 0){
				cout << c_a[i];
				--i;
			}
			cout << endl;
		}

	return 0;
}

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

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

int main()
{
	string s1,s2;
	int n;
	cin>>n;
	while(n--)
	{
		cin>>s1>>s2;
		if(s1.size()>81||s2.size()>81) cout<<"overflow"<<endl;
		else
		{
			int ans[90],now=1;
			int size1=s1.size(),size2=s2.size();
			bool over=false;
			while(1)
			{
				ans[now-1]=0;
				if(size1==0&&size2==0&&!over) break;
				
				if(size1>0)
				{
					ans[now-1]+=s1[size1-1]-'0';
					size1--;
				}
				if(size2>0)
				{
					ans[now-1]+=s2[size2-1]-'0';
					size2--;
				}

				if(over)
				{
					ans[now-1]+=1;
					over=false;
				}
				if(ans[now-1]>=10)
				{
					ans[now-1]%=10;
					over=true;
				}
				now++;
			}
			if(now>81) cout<<"overflow"<<endl;
			else
			{
				for(int i=now-2;i>=0;i--)
				{
					cout<<ans[i];
				}
				cout<<endl;
			}
		}
	}
	return 0;
}

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

int main(){
	int n;
	cin >> n;
	for(int rep=0; rep<n; rep++){
		string str[3];
		cin >> str[0] >> str[1];
		int ml = max(str[0].length(), str[1].length())+1;
		for(int i=0; i<2; i++){
			reverse(str[i].begin(), str[i].end());
			int len = str[i].length();
			for(int j=0; j<ml-len; j++){
				str[i] += "0";
			}
		}
		str[2] = "";
		int c=0;
		for(int i=0; i<ml; i++){
			int n = (str[0][i]-'0')+(str[1][i]-'0')+c;
			if(n>9) c=1;
			else c=0;
			str[2] += string(1, n%10 +'0');
		}
		if(str[2].back()=='0') str[2].pop_back();
		reverse(str[2].begin(), str[2].end());
		if(str[2].length() > 80){
			cout << "overflow" << endl;
		}else{
			cout << str[2] << endl;
		}
	}
	return 0;
}

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

#define CAPACITY 9

 
namespace stoi{
 
    int stoi(std::string str){
        int ret;
        std:: stringstream ss;
        ss << str;
        ss >> ret;
        return ret;
    }
 
}
class OverDigit{
 
public:
 
    int num_a[CAPACITY];
    int num_b[CAPACITY];
    OverDigit(std::string str_a, std::string str_b);
    void ChangeDigit(std::string str,int num[]);
    void Add();
};
 
OverDigit::OverDigit(std::string str_a,std::string str_b){
 
    ChangeDigit(str_a, num_a); 
    ChangeDigit(str_b, num_b);
 
}
 
void OverDigit::ChangeDigit(std::string str, int num[]){
 
    std::vector <int> num_str(CAPACITY, 0);
    int loc = CAPACITY, k = 8;
    int str_Max, str_rest;
 
    str_Max = str.length() / CAPACITY;//
    str_rest = str.length() % CAPACITY;
 
        for (int j = str.length() - CAPACITY; str_Max > 0; j = j-CAPACITY){
        num_str[k] = stoi::stoi(str.substr(j, CAPACITY));
        loc = k;
        k--;
        str_Max--;
    }
     
        if(str_rest!=0)num_str[loc - 1] = stoi::stoi(str.substr(0, str_rest));
 
    for (int j = 0; j < CAPACITY; j++){
    num[j]=num_str[j];
    }
}
//80?????????§?????¶???????
void OverDigit::Add(){
 
    int num_ans[CAPACITY] = {};
    int fat,overflow=0,count=0;
 
    for (int j = CAPACITY-1; j >0; j--){
        if (num_a[j] + num_b[j]<=999999999){
            num_ans[j] = num_a[j] + num_b[j];
        }
        else if (num_a[j] + num_b[j] > 999999999){
            fat = (num_a[j] + num_b[j]) - 1000000000;
            num_ans[j] = fat;
            num_a[j - 1]++;     
        }
 
    }
 
     if (num_a[0] + num_b[0] > 99999999){
        overflow = 1;
     }
     else{
         num_ans[0]= num_a[0] + num_b[0];
          
 
     }
 
    if (overflow == 1){
        std::cout << "overflow" << std::endl;
    }
    else {
        for (int j = 0; j < CAPACITY; j++){
            if (num_ans[j] != 0){
                count++;
                std::cout << num_ans[j];
 
            }
            else if (num_ans[j] == 0 && count >= 1){
                std::cout << "000000000";
            }
 
        }std::cout << std::endl;
    }
 
};
 
 
int main(){
    int N;
    std::string str_a, str_b;
 
    std::cin >> N;
    std::cin.ignore();
 
   for (int i = 0; i < N; i++){
        getline(std::cin, str_a);
        getline(std::cin, str_b);
/*
        OverDigit OverDigit_a(str_a,str_b);
       OverDigit_a.Add();
*/
   }
 
    return 0;
}