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 main()
{
    int num;

    cin >> num;
    for (int i = 0; i < num; i++) {
        string s1, s2;

        cin >> s1 >> s2;
        if (s1.size() > 80 || s2.size() > 80)
            cout << "overflow" << endl;
        else {
            int i1 = s1.size();
            int i2 = s2.size();
            string ans;
            int tmp = 0;
            int up = 0;

            for ( ; (i1 > 0) && (i2 > 0); i1--, i2-- ) {
                tmp = (s1[i1 - 1] + s2[i2 - 1]) - 2 * '0' + up;
                up = tmp / 10;
                tmp %= 10;
                ans = char(tmp + '0') + ans;
            }
            
            if (i1 > 0) {
                for ( ; i1 > 0; i1--) {
                    tmp = s1[i1 - 1] - '0' + up;
                    up = tmp / 10;
                    tmp %= 10;
                    ans = char(tmp + '0') + ans;
                }
            }
            else if (i2 > 0) {
                for ( ; i2 > 0; i2--) {
                    tmp = s2[i2 - 1] - '0' + up;
                    up = tmp / 10;
                    tmp %= 10;
                    ans = char(tmp + '0') + ans;
                }
            }

            if (up > 0)
                ans = char(up + '0') + ans;

            if (ans.size() > 80)
                cout << "overflow" << endl;
            else
                cout << ans << endl;
        }
    }

    return 0;
}

C++: #include <array>
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>

using namespace std;

typedef array<int, 11> BigInt;

string BigInt2String(BigInt bi) {
  reverse(bi.begin(), bi.end());
  char buf[89] = {};
  char *pos = buf;
  for (auto i : bi) {
    sprintf(pos, "%08d", i);
    pos += 8;
  }
  string result(buf);
  return result.substr(result.find_first_not_of('0'));
}
  
BigInt String2BigInt(const string& s) {
  BigInt bi { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };

  string t(s);
  int i = 0;
  while (!t.empty()) {
    size_t offset = t.size() < 8 ? 0 : t.size() - 8;
    bi[i++] = atoi(t.substr(offset).c_str());
    t = t.substr(0, offset);
  }
  return bi;
}

string AddBig(const string& x, const string& y) {
  if (x.size() > 80 || y.size() > 80) { return string("overflow"); }

  BigInt x_bi = String2BigInt(x);
  BigInt y_bi = String2BigInt(y);
  BigInt sum { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };
  for (int i = 0; i < x_bi.size(); ++i) {
    sum[i] += x_bi[i] + y_bi[i];
    if (sum[i] > 99999999) {
      sum[i + 1] = 1;
      sum[i] -= 100000000;
    }
  }
  if (sum[10] != 0) { return string("overflow"); }
  return BigInt2String(sum);
}
  
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string x, y;
    cin >> x;
    cin >> y;
    cout << AddBig(x, y) << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<cstring>
using namespace std;
#define MAX 1000
#define temp 85
int main(){
	int x,A[MAX],B[MAX],al,bl,sum[MAX],pre,now;
	char a[MAX],b[MAX];
	cin>>x;
	while(x-->0){
		for(int i=0;i<MAX;i++){
			A[i]=0;
			B[i]=0;
			sum[i]=0;
		}
		cin>>a;
		cin>>b;
		al=strlen(a);
		bl=strlen(b);
		for(int i=0;i<al;i++)
		A[i]=a[al-1-i]-'0';
		for(int i=0;i<bl;i++)
		B[i]=b[bl-1-i]-'0';
		if(al>bl)
		bl=al;
		pre=0;
		for(int i=0;i<=bl;i++){
			if(A[i]+B[i]+pre>9)
				now=1;
			else now=0;
			sum[i]=(A[i]+B[i]+pre)%10;
			pre=now;
		}
		if(sum[bl]!=0){
		for(int i=bl;i>=0;i--)
		cout<<sum[i];
		}
		else {
		for(int i=bl-1;i>=0;i--)
		cout<<sum[i];
		}
		cout<<endl;
	}
	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);
    if(e>80||f>80)puts("overflow");
   else{ e--;f--;
    for(int g=80;g!=0;g--,e--,f--){
	int s=goukei[g];
	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 <iostream>
#include <iomanip>
#include <string.h>
#include <stdio.h>
using namespace std;

void checkArray(char str[])
// 配列の内容確認(テスト用)
{
	int size = strlen(str);
	for(int i = 0; i < size; ++i)
	{
		cout << "str[" << i << "]: " << str[i] << endl;
	}
}
void str_reverse(char s[])
// 文字列を反転する
{
     int i, l = strlen(s);
     char t;
     for(i = 0; i < l/2; i++) {
         t = s[i]; s[i] = s[l-i-1]; s[l-i-1] = t;
     }
}
void add(char num1[], char num2[])
// 足し算した結果を文字列として返す
{
	char res[82];;
	bool carry = false; //繰り上がりの有無
	int maxlen = (strlen(num1) > strlen(num2)) ? strlen(num1) : strlen(num2);
	int flag1 = 0, flag2 = 0;

	str_reverse(num1);
	str_reverse(num2);

	for(int i = 0; i < maxlen+1; ++i){
		// '\n'以降は値を0とする
		if(num1[i] == '\0') flag1 = 1;
		if(num2[i] == '\0') flag2 = 1;
		res[i] = carry;
		if(!flag1)	res[i] += num1[i]-48;
		if(!flag2)	res[i] += num2[i]-48;
		carry = res[i] / 10;
		res[i] = res[i] % 10 + 48;
	}
	// 終端文字をつける
	if(res[maxlen] == '0')
		res[maxlen] = '\0';
	else res[maxlen+1] = '\0';

	// 元に戻す
	str_reverse(num1);
	str_reverse(num2);
	str_reverse(res);
	if(strlen(res) > 80)
		cout << "overflow" << endl;
	else
		cout << res << endl;
}

int main() {
	int dataset;
	char num1[81];
	char num2[81];

	cin >> dataset; // データセットの個数

	for(int i = 0; i < dataset; ++i){
			// 80桁以下の数字を入力
			cin  >> num1;
			cin  >> num2;
			if(strlen(num1) > 80 || strlen(num2) > 80){
				cout << "overflow" << endl;
			}else
			// 足し算した結果を表示
			add(num1, num2);
	}
	return 0;
}

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

int main(){
	string a,b;
	vector<int> sum;
	int al, bl, sl;
	int n, up, num;
	cin >> n;
	for(int i=0;i<n;++i){
		cin >> a >> b;
		al = a.size()-1;
		bl = b.size()-1;
		up = 0;
		while(al >= 0 || bl >= 0){
			num = up;
			if(al>=0) num += a[al] - 48;
			if(bl>=0) num += b[bl] - 48;
			if(num > 9){
				sum.push_back(num - 10);
				up = 1;
			}else{
				sum.push_back(num);
				up = 0;
			}
			al -= 1;
			bl -= 1;
		}
		if(up == 1){
			sum.push_back(1);
		}
		sl = sum.size();
		if(sl > 80){
			cout << "overflow" << endl;
		}else{
			for(int j=sl-1;j>=0;--j){
				cout << sum[j];
			}
			cout << endl;
		}
		sum.clear();
	}
	return 0;
}

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

int main(){

	int n;

	string a, b;
	char N1[80], N2[80];
	char sum[80];

	cin >> n;

	for( int i=0;i<n;i++ ){

		cin >> a;
		cin >> b;

		if( a.length() >= 80 || b.length() >= 80 )
			cout << "overflow" << endl;

		for( int i=0;i<80;i++ ){
			N1[i] = -1; N2[i] = -1; sum[i] = 0;
		}

		for( int i=1;i<=a.length();i++ )
			N1[i] = a[a.length()-i] - '0';
		for( int i=1;i<=b.length();i++)
			N2[i] = b[b.length()-i] - '0';

		int over = 0;
		
		for( int i=0;i<80;i++ ){


			if( N1[i] == -1 && N2[i] == -1 ){
				if( over >= 10 ){
					sum[i] = over / 10;
					over = 0;
				}else
					sum[i] = -1;
				continue;
			}

			if( N1[i] != -1 )
				sum[i] += N1[i];
			if( N2[i] != -1 )
				sum[i] += N2[i];

			sum[i] += over / 10;

			over = floor((double)sum[i]/10)*10;

			sum[i] -= over;
			
		}

		if(over > 0)cout << "overflow" << endl;
		else{		
			for( int i=1;i<=80;i++ ){
				if( sum[80-i] >= 0 )
					cout << (int)sum[80-i];
			}
			cout << endl;
		}


	}
	return 0;
}