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++: //#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 <boost/multiprecision/cpp_int.hpp>

using namespace boost::multiprecision;

int main()
{
  unsigned int a;
  cpp_int b, c;
  std::cin >> a;
  for (unsigned int i = 0; i < a * 2; ++i) {
    if (i % 2 == 0) {
      std::cin >> b;
    } else {
      std::cin >> c;
      std::cout << b + c << std::endl;
    }
  }
}

C++:     #include <iostream>
    #include <vector>
    #include <string>
	#include <algorithm>
     
    class BigInteger {
    	std::string num_str_;
    public:
    	BigInteger(std::string&& str) {
    		num_str_ = std::move(str);
    	}
    	BigInteger operator+(const BigInteger& rhs) {
    		return plus(rhs);
    	}
    	
    	std::string to_string() const {return num_str_;}
    	
    private:
    	BigInteger plus(const BigInteger& rhs) {
    		std::string a = num_str_;
			std::string b = rhs.to_string();
			std::reverse(a.begin(), a.end());
			std::reverse(b.begin(), b.end());
			const int max = std::max(a.length(), b.length());
			const int min = std::min(a.length(), b.length());

			if (a.length() < b.length()) {
				std::swap(a, b);
			}
			for (int i = min; i < max; ++i) {
				b.push_back('0');
			}

			std::string result("");
			int carry = 0;
			for (int i = 0; i < max; ++i) {
				int sum = to_int(a.at(i)) + to_int(b.at(i)) + carry;
				carry = sum / 10;
				const char c_num = to_char(sum % 10);
				result.push_back(c_num);
			}
			if (carry > 0) {
				result.push_back(to_char(carry));
			}
			
			std::reverse(result.begin(), result.end());
			return BigInteger(std::move(result));
    	}
    	
    	int to_int(const char& c) const {
    		return c - '0';
    	}
    	char to_char(const int& i) const {
    		return i + '0';
    	} 
    };
     
    int main() {
    	std::vector<BigInteger> ans_list;
    	int n;
    	std::cin >> n;
    	for (int i = 0; i < n; ++i) {
    		std::string str1, str2;
    		std::cin >> str1 >> str2;
    		BigInteger bi1(std::move(str1));
    		BigInteger bi2(std::move(str2));
    		ans_list.push_back(bi1 + bi2);
    	}
    	
    	for (auto ans : ans_list) {
    		auto ans_str = ans.to_string();
    		std::cout << (ans_str.length() > 80 ? "overflow" : ans_str) << std::endl;
    	}
    }

C++: #include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
	int d;
	for(cin>>d;d>0;d--){
		char ans[200];
		char n1[200];
		char n2[200];
		for(int i=0;i<=100;i++)ans[i]='0';
		scanf("%s",n1);
		scanf("%s",n2);
		int h1=strlen(n1)-1;
		int h2=strlen(n2)-1;
		int limit=max(h1,h2);
		int i;
		bool flg=false;
		for( i=0;i<=limit;i++,h1--,h2--){
			flg=false;
			int n1_tmp=0;
			int n2_tmp=0;
			if(h1>=0){
				n1_tmp=n1[h1]-'0';
			}
			if(h2>=0){
				n2_tmp=n2[h2]-'0';
			}
			int sum=n1_tmp+n2_tmp;
			if(sum>=10){
				if(i==79){
					i++;
					flg=true;
					break;
				}
				ans[i+1]=ans[i+1]+1;
				sum=sum%10;
				flg=true;
			}

			if(ans[i]+sum>'9'){
				if(i==79){
					i++;
					flg=true;
					break;
				}
				ans[i]=ans[i]+(sum-10);
				ans[i+1]+=1;
				flg=true;
			}
			else ans[i]+=sum;
		}
		if(flg){
			i++;
		}
		ans[i]='\0';
		if(i>80)cout<<"overflow"<<endl;
		else{
			for(i--;i>=0;i--){
				cout<<ans[i];
			}
			cout<<endl;
		}
//		cout<<"size:"<<strlen(ans)<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int n;
  cin>>n;
  while(n--){
    long long int a,b;
    cin>>a>>b;
    cout<<a+b<<endl;
  }
}

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

int changeNumber(char number)
{
	int num = 0;
	for (char i = 48; i < 58; i++) {
		if (number == i) return num;
		num++;
	}
}

void puls(string number1, string number2)
{
	stack<int> s;
	int tmp = 0;
	for (int i = 1; i <= number1.size() && i <= number2.size(); i++) {
		tmp =  tmp + changeNumber(number1[number1.size() - i]) + changeNumber(number2[number2.size() - i]);
		s.push(tmp % 10);
		tmp /= 10;
	}
	for (int i = number2.size() + 1; i <= number1.size(); i++) {
		tmp = tmp + changeNumber(number1[number1.size() - i]);
		s.push(tmp % 10);
		tmp /= 10;
	}
	if (tmp > 0) s.push(tmp);
	if (s.size() > 80) cout << "overflow" << endl;
	else {
		while(0 < s.size()) {
			cout << s.top();
			s.pop();
		}
		cout  << endl;
	}
}

int main(void)
{
	string number1, number2;
	int count;

	cin >> count;
	for (int i = 0; i < count; i++) {
		cin >> number1 >> number2;
		if (number1.size() < number2.size()) puls(number2, number1);
		else puls(number1, number2);
	}
	
	return 0;
}