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<vector>
#include<algorithm>
#include<string>

void swap(std::string& str1, std::string& str2)
{
	std::string temp;

	temp = str1;

	str1 = str2;

	str2=temp;
}

int main()
{
	int n=0;

	std::cin >> n;

	for(int i=0; i<n; ++i)
	{
		std::vector<int> a, b;

		std::string stra, strb;

		std::cin >> stra >> strb;

		if(stra.length()<strb.length())
		{
			swap(stra,strb);
		}

		for(size_t i=0; i<stra.length(); ++i)
		{
			a.push_back(stra[stra.length()-1-i]-48);
		}

		for(size_t i=0; i<strb.length(); ++i)
		{
			b.push_back(strb[strb.length()-1-i]-48);
		}

		for(size_t i=0; i<b.size(); ++i)
		{
			a[i] += b[i];
		}

		for(size_t i=0; i<a.size()-1; ++i)
		{
			if(a[i]>=10)
			{
				++a[i+1];

				a[i] %= 10;
			}
		}

		if(a[a.size()-1]>=10)
		{
			a[a.size()-1] %= 10;

			a.push_back(1);
		}
		
		if(a.size()>80)
		{
			std::cout << "overflow";
		}
		else
		{
			for(size_t i=0; i<a.size(); ++i)
			{
				std::cout << a[a.size()-1-i];
			}	
		}

		std::cout << '\n';
	}
}

C++: #include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,lengthof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };

int main() {
	int n;
	cin >> n;
	while (n--){
		string s1, s2;
		cin >> s1 >> s2;
		string ans = "";
		int s1l = s1.length();
		int s2l = s2.length();
		bool up = false;
		REP(i, max(s1l, s2l)){
			int a = up ? 1 : 0;
			if (s1l - i - 1 >= 0)
				a += s1.c_str()[s1l - i - 1] - '0';
			if (s2l - i - 1 >= 0)
				a += s2.c_str()[s2l - i - 1] - '0';
			up = (a >= 10);
			ans = to_string(a % 10) + ans;
			if (max(s1l, s2l) - i-1 == 0 && up)ans = "1" + ans;
		}
		cout<<ans<<endl;
	}
}

C++: #include <iostream>
#include <stack>

std::string num_1, num_2;

void solver() {
    std::stack<char>ss_1, ss_2;
    std::stack<int> ss;
    bool flag=false;
    int tmp;
    for (int i=0; i<num_1.length(); i++) {
        ss_1.push(num_1[i]);
    }
    for (int j=0; j<num_2.length(); j++) {
        ss_2.push(num_2[j]);
    }

    while (!ss_1.empty() && !ss_2.empty()) {
        tmp = (ss_1.top() - '0') + (ss_2.top() - '0');
        ss_1.pop();
        ss_2.pop();

        if (flag) {
            tmp += 1;
        }
        ss.push(tmp % 10);

        flag = (tmp > 9) ? true:false;
    }
    if (ss_1.empty() && !ss_2.empty()) {
        while (!ss_2.empty()) {
            tmp = ss_2.top() - '0';
            if (flag) tmp += 1;

            ss.push(tmp % 10);
            ss_2.pop();
            flag = (tmp > 9) ? true:false;
        }
    } else if (ss_2.empty() && !ss_1.empty()) {
        while (!ss_1.empty()) {
            tmp = ss_1.top() - '0';
            if (flag) tmp += 1;

            ss.push(tmp % 10);
            ss_1.pop();
            flag = (tmp > 9) ? true:false;
        }
    }
    if (flag) ss.push(1);
    if (ss.size() > 80) {
        std::cout << "overflow" << std::endl;
    } else {
        while (!ss.empty()) {
            std::cout << ss.top();
            ss.pop();
        }
        std::cout << std::endl;
    }
}

int main(void) {
    int n;

    std::cin >> n;

    for (int i=0; i<n; i++) {
        std::cin >> num_1;
        std::cin >> num_2;
        solver();
    }

    return 0;
}

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

int main(){
	string sa,sb;
	int a[100],b[100],res[100],n;
	cin >> n;
	for(int i=0;i<n;i++){
		fill(a,a+100,0); fill(b,b+100,0); fill(res,res+100,0);
		cin >> sa >> sb;
		int a_len = sa.length(),b_len = sb.length(),res_len=0;
		if(a_len>80 || b_len>80){
			f:
			printf("overflow\n");
			continue;
		}
		for(int j=0;j<a_len;j++)
			a[j] = sa[a_len-1-j]-'0';
		for(int j=0;j<b_len;j++)
			b[j] = sb[b_len-1-j]-'0';
		for(int j=0;j<max(a_len,b_len);j++){
			res[j] += a[j]+b[j];
			res[j+1] = res[j]/10;
			res[j] %=10;
		}
		string s="";bool flag=false;
		for(int j=max(a_len,b_len);j>=0;j--){
			if(!flag && res[j]!=0){
				flag=true;
				if(j >=80) goto f;
			}
			if(flag){
				printf("%d",res[j]);
			}
		}
		printf("\n");
	}
}

C++: #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main() {
	int n;
	cin >> n;
	string k, l;
	for(int j=0;j<n;j++) {
		int c = 0, d;
		cin >> k >> l;
		string g = "";
		string a="", b="";
		for (int i = k.length() - 1; i >= 0; i--) 
			a += k[i];
		for (int i = l.length()-1; i >= 0; i--)
			b += l[i];
		for (int i = 0; i < max(a.length(), b.length()) + 1; i++) {
			if (i < min(a.length(), b.length())) {
				int e = (int)a[i] - '0', f = (int)b[i] - '0';
				d = e + f + c;
				if (d >= 10) {
					g += (char)(d - 10) + '0';
					c = 1;
				}
				else {
					g += (char)d + '0';
					c = 0;
				}
			}
			else if (i < a.length()) {
				int e = (char)a[i] - '0';
				e += c;
				if (e >= 10) {
					g += (char)(e - 10) + '0';
					c = 1;
				}
				else {
					g += (char)e + '0';
					c = 0;
				}
			}
			else if (i < b.length()) {
				int e = (char)b[i] - '0';
				e += c;
				if (e >= 10) {
					g += (char)(e - 10) + '0';
					c = 1;
				}
				else {
					g += (char)e + '0';
					c = 0;
				}
			}
			else if (c == 1) {
				g += (char)c + '0';
				c = 0;
			}
		}
		string h = "";
		if (g.length() >= 81)
			cout << "overflow" << endl;
		else {
			for (int i = g.length() - 1; i >= 0; i--)
				h +=g[i];
			cout << h << endl;
		}
	}
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
 string s1,s2;
 int a1[100],a2[100],i,n,l1,l2,l;
 cin>>n;
 while(n--){
   cin>>s1>>s2;
   l1=s1.size();
   l2=s2.size();
   for(i=l1-1;i>-1;i--)
     a1[i]=int(s1[l1-i-1])-int('0');
   for(i=l2-1;i>-1;i--)
     a2[i]=int(s2[l2-i-1])-int('0');
   if(l1>l2)
     l=l1;
   else
     l=l2;
   for(i=0;i<l;i++){
     a1[i]=(a1[i]+a2[i])%10;
     a1[i+1]+=(a1[i]+a2[i])/10;
   }
   if (a1[l]==1)
    ++l;
   if (l<=80){
     for(i=l-1;i>-1;i--)
       cout<<a1[i];
       cout<<endl;
   }
   else {
     cout<<"overflow"<<endl;
     continue;
   }
 }
 return 0;
}