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

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

constexpr int MAX_DIGIT = 80;
constexpr int OVERFLOW = 20;

int main()
{
    int data_num;
    cin >> data_num;

    while (data_num--) {
        string in01_str, in02_str;
        cin >> in01_str >> in02_str;

        vector<int> in01(MAX_DIGIT + OVERFLOW, 0), in02(MAX_DIGIT + OVERFLOW, 0);
        for (unsigned i = 0; i < in01_str.size(); i++) {
            in01.at(i) = in01_str.at(in01_str.size() - 1 - i) - '0';
        }
        for (unsigned i = 0; i < in02_str.size(); i++) {
            in02.at(i) = in02_str.at(in02_str.size() - 1 - i) - '0';
        }

        if (in01.at(MAX_DIGIT) != 0 || in02.at(MAX_DIGIT) != 0) {
            cout << "overflow" << endl;
        }

        vector<int> out(MAX_DIGIT + OVERFLOW, 0);
        for (unsigned i = 0; i < MAX_DIGIT; i++) {
            out.at(i) += in01.at(i) + in02.at(i);
            if (out.at(i) / 10 != 0) {
                out.at(i) -= 10;
                out.at(i + 1)++;
            }
        }

        if (out.at(MAX_DIGIT) != 0) {
            cout << "overflow" << endl;
            continue;
        }

        while (out.at(out.size() - 1) == 0 && out.size() != 1) {
            out.erase(out.end() - 1);
        }

        for (unsigned i = 0; i < out.size(); i++) {
            cout << out.at(out.size() - 1 - i);
        }
        cout << endl;
    }
}

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

using namespace std;

void tasu(string s1, string s2){
        int num[2][max(s1.length(), s2.length())+1];
        for(int i = 0; i < sizeof(num[0])/sizeof(int); i++){
                if(s1.length() > i){ 
                        num[0][i] = (int)s1.at(s1.length()-1-i) - (int)'0';
                }else{
                        num[0][i] = 0;
                }   
                if(s2.length() > i){ 
                        num[1][i] = (int)s2.at(s2.length()-1-i) - (int)'0';
                }else{
                        num[1][i] = 0;
                }   
        }   
        for(int i = 0; i < sizeof(num[0])/sizeof(int)-1; i++){
                num[1][i] += num[0][i];
                if(num[1][i] > 9){ 
                        num[1][i+1] += (int)(num[1][i]/10);
                        num[1][i] %= 10; 
                }   
        }   
        int keta = sizeof(num[0])/sizeof(int);
        while(keta && !num[1][keta-1]){
                keta--;
        }   
        if(keta > 80){
                cout << "overflow" << endl;
        }else{
                while(keta--){
                        cout << num[1][keta];
                }   
                cout << endl;
        }   
}
int main(){
        int n;
        cin >> n;
        while(n--){
                string s1, s2; 
                cin >> s1 >> s2; 
                tasu(s1, s2);
        }   
}

C++: #include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using lint = long long int;
using ulint = unsigned long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T, class U> void assign(V<T>& v, int n, const U& a) { v.assign(n, a); }
template<class T, class... Args> void assign(V<T>& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); }


string add(string& a, string& b) {
  int n = max(a.size(), b.size()) + 1;
  reverse(begin(a), end(a));
  reverse(begin(b), end(b));
  while (a.size() < n) a += '0';
  while (b.size() < n) b += '0';
  string c(n, 0);
  int d = 0;
  for (int i = 0; i < n; ++i) {
    int x = (a[i] - '0') + (b[i] - '0') + d;
    if (x < 10) {
      c[i] = '0' + x;
      d = 0;
    } else {
      c[i] = '0' + x - 10;
      d = 1;
    }
  }
  while (c.size() > 1 and c.back() == '0') c.pop_back();
  reverse(begin(c), end(c));
  return c;
}

int main() {
  cin.tie(nullptr); ios_base::sync_with_stdio(false);
  int n; cin >> n;
  for (int _ = 0; _ < n; ++_) {
    string a, b; cin >> a >> b;
    auto c = add(a, b);
    if (c.size() > 80) cout << "overflow" << '\n';
    else cout << c << '\n';
  }
}

C++: #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
	int n,m;
	string aindex, bindex, ans;
	cin >> m;
	n = 0;
	string a,b;
	for(int j = 0; j < m; j++){
		cin >> a >> b;
		if(a.size()>80||b.size()>80){
			cout << "overflow" << endl;
		}else{
			for(int i = 0; i< max(a.size(),b.size()); i++){
				if(a.size()>= i+1){
					aindex = a[a.size()-i-1];
				}else{
					aindex = "0";
				}
				if(b.size() >= i+1){
					bindex = b[b.size()-i-1];
				}else{
					bindex = "0";
				}
				n = stoi(aindex) + stoi(bindex) + (n-n%10==10);
				aindex = to_string(n%10);
				ans = aindex + ans;
			}
			if(ans.size()>80){
				cout << "overflow" << endl;
			}else{
				if(n-n%10 == 10){
					ans = '1' + ans;
				}
				cout << ans << endl;
			}
		}
		ans ="";
		n = 0;
	}
}

C++: #include <stdio.h>
#include <string.h>
 
int max(int a, int b) {
  return a > b ? a : b;
}
 
int main(void) {
  int i, ans = 0, j, n;
  char a[110], b[110];
  scanf("%d", &n);
  for(i = 0; i < n; ++i) {
    scanf("%s\n%s", a, b);
    if(strlen(a) > 80 || strlen(b) > 80) {
      printf("overflow\n");
      continue;
    }
    for(j = 0; j < strlen(a); ++j) a[j] -= '0' - 1;
    for(j = 0; j < strlen(b); ++j) b[j] -= '0' - 1;
    /*for(j = 0; j < strlen(a); ++j) printf("%d", (int)a[j] - 1);
    printf("\n");
    for(j = 0; j < strlen(b); ++j) printf("%d", (int)b[j] - 1);
    printf("\n");*/
    if(strlen(a) < strlen(b)) {
      char t[110];
      for(j = 0; j <= strlen(a); ++j) t[j] = a[j];
      for(j = 0; j <= strlen(b); ++j) a[j] = b[j];
      for(j = 0; j <= strlen(t); ++j) b[j] = t[j];
    }
    char t[110];
    int st = 0;
    for(j = 0; j <= strlen(b); ++j) t[j] = b[j];
    for(j = 0; j <= strlen(a); ++j) b[j] = 1;
    for(j = strlen(a) - strlen(t); j <= strlen(a); ++j) b[j] = t[j - strlen(a) + strlen(t)];
    /*for(j = 0; j < strlen(a); ++j) printf("%d", (int)a[j] - 1);
    printf("\n");
    for(j = 0; j < strlen(a); ++j) printf("%d", (int)b[j] - 1);
    printf("\n");*/
    for(j = strlen(a) - 1; j >= 0; --j) {
      a[j] = a[j] + b[j] - 1;
      if(a[j] >= 11) {
        if(j) {
          a[j - 1]++;
          a[j] -= 10;
        } else {
          st = 1;
          a[j] -= 10;
        }
      }
    }
    if(st) {
      if(strlen(a) == 80) {
        printf("overflow\n");
        continue;
      } else printf("1");
    }
    for(j = 0; j < strlen(a); ++j) printf("%d", (int)a[j] - 1);
    printf("\n");
  }
  return 0;
}

C++: #include <cstdio>
#include <vector>
#include <cmath>
#include <algorithm>

using namespace std;

#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)

typedef vector<int> vi;

int main()
{
	int n;
	scanf("%d%*c", &n);
	rep(i, n){
		vi a, b;
		char c;
		while(scanf("%c", &c), c != '\n')
			a.push_back(c-'0');
		while(scanf("%c", &c), c != '\n')
			b.push_back(c-'0');
		
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());

		int kuri = 0;
		vi ans;
		for(int j=0, k=0; j<(int)a.size() || k<(int)b.size() || kuri; ++j, ++k){
			int v = (j<(int)a.size() ? a[j] : 0) + (k<(int)b.size() ? b[k] : 0) + kuri;
			kuri = v/10;
			ans.push_back(v%10);
		}

		if(ans.size()>80)
			puts("overflow");
		else{
			for(int j=ans.size()-1; j>=0; --j)
				printf("%d", ans[j]);
			puts("");
		}
	}
	return 0;
}