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 <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)

vector<int> a(200);
vector<int> b(200);
vector<int> comp(200);

void dfs(int i){
	//i?????????1?¶????
	if (comp[i]<9){
		comp[i]++;
	}
	else{
		comp[i]=0;
		dfs(i+1);
	}
}

int main(){
	int N;
	cin>>N;
	REP(i,N){
		string s1,s2;
		REP(j,200){
			a[j]=b[j]=0;
		}
		cin>>s1;
		cin>>s2;
		REP(j,s1.size()){
			comp[j]=s1[s1.size()-j-1]-'0';
		}
		REP(j,s2.size()){
			b[j]=s2[s2.size()-j-1]-'0';
		}
		REP(j,s2.size()){
			comp[j]+=b[j];
			if (comp[j]>9){
				comp[j]-=10;
				dfs(j+1);
			}
		}
		int fl=200-1;
		while(!comp[fl]) fl--;
		fl++;
		if (fl>80){
			cout<<"overflow"<<endl;
		}
		else{
			for(int k=fl-1;k>=0;k--){
				cout<<comp[k];
			}
			cout<<endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>
#include<iomanip>

#define EPS (1e-10)
using namespace std;
#define PI (3.1415926535)

int main(){
	string a, b;
	vector<int> m, n, s;
	int set;

	m.resize(81, 0);
	n.resize(81, 0);
	s.resize(81, 0);

	cin >> set;
	while(set-- > 0){
		cin >> a >> b;
		for(int i = 0; i < 81; i++){
			m[i] = n[i] = s[i] = 0;
		}		
		if(a.size() > 80 || b.size() > 80){
			cout << "overflow" << endl;
		}else{
			reverse(a.begin(), a.end());
			reverse(b.begin(), b.end());
			for(int i = 0; i < a.size(); i++){
				m[i] = a[i] - '0';
			}
			for(int i = 0; i < b.size(); i++){
				n[i] = b[i] - '0';
			}
			for(int i = 0; i < 80; i++){
				s[i] += m[i] + n[i];
				if(s[i] >= 10){
					s[i+1]++;
					s[i]-=10;
				}
			}
			int digit = 81;
			while(--digit > 0){
				if(s[digit] != 0){
					break;
				}
			}
			if(digit >= 80){
				cout << "overflow" << endl;
			}else{
				for(int i = digit; i >= 0; i--){
					cout << s[i];
				}
				cout << endl;
			}
		}
	}

	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include <utility>
using namespace std;
using namespace std;
int main(){
	
	int m;
	char in[2][100];
	char ans[100];
	int ie[2];
	int ien[2];
	bool max10;
	int Min;
	bool NMin;
	scanf("%d",&m);
	for(;m--;){
		
		for(int i=0;i<2;i++){
			scanf(" %s",&in[i]);
		}
		ie[0]=strlen(in[0])-1;
		ie[1]=strlen(in[1])-1;
		Min=max(ie[0],ie[1]);
		if((Min>79)||((Min>78)&&(ie[0]==ie[1])&&((int(in[0][0])+int(in[1][0]))>9))){
			cout<<"overflow"<<endl;
		}else{	
			if(ie[0]>ie[1]){
				NMin=0;
			}else{
				NMin=1;
			}
			ien[0]=ie[0];
			ien[1]=ie[1];
			for(;min(ien[0],ien[1])+1;ien[0]--,ien[1]--){
				in[NMin][ien[NMin]]=in[0][ien[0]]+in[1][ien[1]]-'0';
				if(in[NMin][ien[NMin]]>9+'0'){
					in[NMin][ien[NMin]]-=10;
					in[NMin][ien[NMin]-1]  +=1;
				}
			}
			max10=0;
			for(;ien[NMin]>-1;ien[NMin]--){
				if(in[NMin][ien[NMin]]>9+'0'){
					in[NMin][ien[NMin]]-=10;
					in[NMin][ien[NMin]-1]+=1;
					max10=1;
				}else{
					max10=0;
				}
			}
			if(max10) cout<<"1";
			cout<<in[NMin]<<endl;
		}
	}
	return 0;
}

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);
	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;
}

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

int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		string s1, s2;
		int l1, l2;
		cin >> s1 >> s2;
		l1 = s1.length();
		l2 = s2.length();
		if (l1>80 || l2 > 80)
			cout << "overflow" << endl;	
		else
		{
			int result[100], r = 0, m = max(l1, l2);
			reverse(s1.begin(), s1.end());
			reverse(s2.begin(), s2.end());
			for (int j = 0; j < m; j++)
			{
				if (s1[j] == NULL)
					s1[j] = '0';
				if (s2[j] == NULL)
					s2[j] = '0';
				int t = s1[j] + s2[j] - 48 * 2;
				result[j] = r + t % 10;
				r = t / 10;
			}
			if (r == 1)
				result[m++] = 1;
			for (int j = m - 1; j >= 0; j--)
				cout << result[j];
		}
		cout << endl;
	}
	return 0;
}

C++: #include <vector>
#include <iostream>
#include <set>
#include <cstdio>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <ctime>
#include <cmath>
#include <complex>
#include <algorithm>
#include <tuple>
#include <algorithm>
#include <limits>
#include <map>
#include <valarray>
#include <list>

using namespace std;

typedef long long ll;

int main() {
    int t;
    cin >> t;
    while (t--) {
        string s1, s2;
        cin >> s1 >> s2;
        if (s1 == "0" && s2 == "0") {
            cout << "0" << endl;
            continue;
        }
        reverse(s1.begin(), s1.end());
        reverse(s2.begin(), s2.end());
        int n = max(s1.size(), s2.size()) + 1;
        for (int i = s1.size(); i < n; i++) {
            s1 += '0';
        }
        for (int i = s2.size(); i < n; i++) {
            s2 += '0';
        }
        string res;
        int b = 0;
        for (int i = 0; i < max(s1.size(), s2.size()); i++) {
            int u = s1[i]-'0'+s2[i]-'0'+ b;
            b = (u >= 10); u %= 10;
            res += u + '0';
        }
        reverse(res.begin(), res.end());
        string res2;
        int j = 0;
        while (res[j] == '0') j++;
        for (; j < res.size(); j++) {
            res2 += res[j];
        }
        if (res2.size() >= 80) {
            cout << "overflow" << endl;
        } else {
            cout << res2 << endl;
        }
    }
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include<string.h>
#include <utility>
using namespace std;
using namespace std;
int main(){
	int m;
	string in,in2;
	int a[90],b[90],ans[90];
	int f;
	int a_len,b_len,m_len;
	cin>>m;
	while(m--){
		for(int i=0;i<90;i++){
			a[i]=b[i]=ans[i]=0;
		}
		cin>>in;
		cin>>in2;
		a_len=in.size();
		b_len=in2.size();
		for(int i=0;i<a_len;i++){
			a[a_len-1-i]=in[i]-'0';
		}
		for(int i=0;i<b_len;i++){
			b[b_len-1-i]=in[i]-'0';
		}
		m_len=max(a_len,b_len);
		/*
		if(m_len>80){
			cout<<"overflow"<<endl;
			continue;
		}
		f=0;
		for(int i=0;i<m_len+1;i++){
			ans[i]=(a[i]+b[i]+f)%10;
			f=(a[i]+b[i]+f)/10;
		}
		if(ans[m_len]!=0){
			if(m_len>79){
				cout<<"overflow"<<endl;
				continue;
			}
			cout<<ans[m_len];
		}
		for(int i=0;i<m_len;i++){
			cout<<ans[m_len-1-i];
		}cout<<endl;
		
		*/
	}
	return 0;
}