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>

using namespace std;

int maxLength(const int &len1, const int &len2) {
	return len1 > len2 ? len1 : len2;
}


int main()
{
	int N;

	cin >> N;

	for (int i = 0; i < N; i++) {
		string s1, s2;
		cin >> s1 >> s2;
		//cout << s1 << endl << s2 << endl;
		int len1 = s1.size();
		int len2 = s2.size();
		int max = maxLength(len1, len2);
		if (max > 80) {
			cout << "overflow" << endl;
			continue;
		}

		int str[100] = {0};
		int acc = 0;
		for (int i = 0; i < max; i++) {
			if (len1 > i && len2 > i) {
				str[i] = (s1[len1-1-i] - '0') + (s2[len2-1-i] - '0') + acc;
			}
			else if(len1 > i) {
				str[i] = (s1[len1 - 1 - i] - '0') + acc;
			}
			else if (len2 > i) {
				str[i] = (s2[len2 - 1 - i] - '0') + acc;
			}
			acc = 0;
			if (str[i] > 9) {
				acc = 1;
				str[i] %= 10;
			}
		}
		if (max == 80 && acc == 1) {
			cout << "overflow" << endl;
			continue;
		}

		str[max] = acc;

		for (int i = acc == 1? max:max-1; i > -1; i--) {
			cout << str[i];
		}
		cout << endl;
	}

	return 0;
}

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

class BigInt {
    static const int base = 10;
    public:
    deque<int> digits;
    BigInt() {
    }
    BigInt operator +(BigInt x) {
        BigInt c;

        // add
        auto di = digits.begin(), xi = x.digits.begin();
        for (; di != digits.end() && xi != x.digits.end(); di++, xi++)
            c.digits.push_back(*di + *xi);

        // set rest
        if (di == digits.end())
            di = xi;
        for (; di != digits.end(); di++)
            c.digits.push_back(*di);

        // nomalize
        int carry = 0;
        for (int i = 0; i < c.size(); i++) {
            c.digits[i] += carry;
            carry = c.digits[i] / base;
            c.digits[i] %= base;
        }
        if (carry)
            c.digits.push_back(carry);

        return c;
    }
    int size() {
        return digits.size();
    }
    istream &read(istream &is) {
        digits.clear();
        cin.ignore();

        int s;
        while (s = cin.get(), isdigit(s))
            digits.push_front(s - '0');
        is.putback(s);

        return is;
    }
    ostream &write(ostream &os) {
        for (auto di = digits.rbegin(); di != digits.rend(); di++)
            cout << *di;
        return os;
    }
};

istream &operator>>(istream &is, BigInt &b) { return b.read(is); }
ostream &operator<<(ostream &os, BigInt &b) { return b.write(os); }

int main()
{
    for (int n; cin >> n;)
        for (BigInt a, b, c; n-- && cin >> a >> b;) {
            c = a + b;
            if (c.size() < 80)
                cout << c << endl;
            else
                cout << "overflow" << endl;
        }

    return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
using namespace std;

int main(){
	int n;
	cin>>n;
	rep(i,0,n){
		int ans[85]={},n1[81]={},n2[81]={};
		string s1,s2;
		cin>>s1>>s2;
		int sz1=s1.size(),sz2=s2.size();

		rep(j,0,sz1) n1[j]=s1[sz1-1-j]-'0';
		rep(j,0,sz2) n2[j]=s2[sz2-1-j]-'0';

		for(int j=0;j<81;j++){
			//cout<<"  "<<j<<" "<<n1[j]<<n2[j]<<endl;
			int a=ans[j]+n1[j]+n2[j];
			ans[j]=a%10;
			ans[j+1]=a/10;
			//cout<<" "<<j<<" "<<ans[j]<<endl;
		}
		if(ans[80]>0){
			cout<<"overflow"<<endl; return 0;
		}
		bool f=0;
		for(int i=80;i>=0;i--){
			if(f==0 && ans[i]>0){
				f=1; cout<<ans[i];
			}else if(f) cout<<ans[i];
		}
		cout<<endl;
	}
}

C++: #include<stdio.h>
#include<string.h>

int main()
{
	char  input1[1001]={0},input2[1001]={0};
	int   output[1002]={0};
	int lengs1=0,lengs2=0,lengs3=0,lengs4=0,count;
	
	scanf("%d",&count);

	for(int c=0;c<count;c++)
	{
		int i,j=1,k;
		for(k=0;k<1000;k++)
		{
			input1[k]=0;
			input2[k]=0;
			output[k]=0;
		}
		scanf("%s",&input1);
		scanf("%s",&input2);

		lengs1=strlen(input1);
		lengs2=strlen(input2);

		if(lengs1>80 || lengs2>80)
		{
			printf("overflow");
			continue;
		}

		lengs3=(lengs1>=lengs2)?lengs1+1:lengs2+1;
		lengs4=lengs3;
		while(lengs3>=0 && lengs1>=0 && lengs2>=0)
		{
			output[lengs3]+=(input1[lengs1--]-'0')+(input2[lengs2--]-'0');
			if(output[lengs3]>=10)
			{
				output[lengs3]%=10;
				output[lengs3-1]+=1;
			}
			lengs3--;
		}

		if(lengs1>=0||lengs2>=0)
		{
			while(lengs1>=0)
			{
				output[lengs3]+=(input1[lengs1--]-'0');
				if(output[lengs3]>=10)
				{
					output[lengs3]%=10;
					output[lengs3-1]+=1;
				}
				lengs3--;
			}
			while(lengs2>=0)
			{
				output[lengs3]+=(input2[lengs2--]-'0');
				if(output[lengs3]>=10)
				{
					output[lengs3]%=10;
					output[lengs3-1]+=1;
				}
				lengs3--;
			}
		}
		if(lengs4>80)
		{
			printf("overflow");
			continue;
		}
		if(output[0]!=0)
			j=0;
		for(i=j;i<lengs4;i++)
		{
			printf("%d",output[i]);
		}
		printf("\n");
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
 
signed main(){
int a;
cin>>a;
for(int b=0;b<a;b++){
    int goukei[81]{};
    char c[110]{},d[110]{};
    scanf("%s%s",c,d);
    int e,f;
    e=strlen(c);f=strlen(d);
    e--;f--;
    if(e>80||f>80)puts("overflow");
    for(int g=80;g!=0;g--,e--,f--){
	int s=0;
	if(e>-1)s+=c[e]-48;
	if(f>-1)s+=d[f]-48;
	goukei[g-1]=s/10;
	goukei[g]+=s%10;
	}
	if(goukei[0])puts("overflow");
	else{
	    bool ss=false;
	    for(int m:goukei){
		if(m)ss=true;
		if(ss)printf("%d",m);
		}
	    }
	    puts("");
    }
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
#include <string.h>
using namespace std;

#define FOR(i,s,e) for (int i = int(s); i != int(e); i++)
#define REP(i,e) for (int i = 0; i != int(e); i++)
#define FORIT(i, A) for (auto i : A)
#define ISEQ(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << endl
#define SZ(x) ((int)(x).size())

int main(int argc, char const *argv[])
{
	int n;
	scanf("%d", &n);
	REP(i, n)
	{
		char buf1[101], buf2[101];
		memset(buf1, 0, 101);
		memset(buf2, 0, 101);
		char sum[101];
		memset(sum, 0, 101);
		scanf("%s", buf1);
		scanf("%s", buf2);
		int l, l1 = 0, l2 = 0;
		for (l = 0; l < 100; l++)
		{
			if (buf1[l] == '\0' && l1 == 0)
			{
				l1 = l;
			}
			if (buf2[l] == '\0' && l2 == 0)
			{
				l2 = l;
			}
			if (l1 > 0 && l2 > 0) break;
		}
		l1--;
		l2--;
		l = (l1 > l2) ? l1 : l2;
		if (l >= 80)
		{
			printf("overflow\n");
			continue;
		}
		l++;
		bool plus = false;
		for (;l >= 0; l--)
		{
			int v1 = (l1 >= 0) ? buf1[l1] - '0': 0;
			int v2 = (l2 >= 0) ? buf2[l2] - '0': 0;
			int v = v1 + v2 + ((plus) ? 1 : 0);
			if (v > 9) 
			{
				plus = true;
				v -= 10;
			}
			else
			{
				plus = false;
			}
			sum[l] = '0' + v;
			l1--;
			l2--;
			if (l1 < 0 && l2 < 0 && !plus) break;
		}
		if (sum[0] == '\0')
		{
			printf("%s\n", &sum[1]);
		}
		else if (sum[80] != 0)
		{
			printf("overflow\n");
		}
		else
		{
			printf("%s\n", sum);
		}
	}
	return 0;
}