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>

int main()
{
        char a[1000], b[1000];
        int c[80], ca, cb, set, up = 0;
        std::cin >> set;

        for(int i = 0; i < set; ++i)
        {
                for(int j = 0; j < 80; ++j)
                        c[j] = 0;
                up = ca = cb = 0;
                std::cin >> a >> b;

                for(int j = 0; j < 1000; ++j)
                        if((a[j] - '0' < 0) || (a[j] - '0' > 9))
                        {
                                ca = j - 1;
                                break;
                        }

                if(ca > 79)
                {
                        std::cout << "overflow" << std::endl;
                        continue;
                }

                for(int j = 0; j < 1000; ++j)
                        if((b[j] - '0' < 0) || (b[j] - '0' > 9))
                        {
                                cb = j - 1;
                                break;
                        }

                if(cb > 79)
                {
                        std::cout << "overflow" << std::endl;
                        continue;
                }
                for(int j = 0; j < 80; ++j)
                {
                        if(ca < j && cb < j)
                        {
                                c[j] = up % 10;
                                up = up / 10;
                        }
                        else if(ca < j)
                        {
                                c[j] = (b[cb - j] - '0' + up) % 10;
                                up = (b[cb - j] - '0' +up) / 10;
                        }
                        else if(cb < j)
                        {
                                c[j] = (a[ca - j] - '0' + up) % 10;
                                up = (a[ca - j] - '0' +up) / 10;
                        }
                        else
                        {
                                c[j] = (a[ca - j] - '0' + b[cb - j] - '0' + up) % 10;
                                up = (a[ca -j] - '0' + b[cb - j] - '0' +up) / 10;
                        }
                }

                if(up > 0)
                {
                        std::cout << "overflow" << std::endl;
                        continue;
                }

                int k = 0;
                for(int j = 0; j < 80; ++j)
                        if(c[79 - j])
                        {
                                k = j;
                                break;
                        }

                if(k)
                        for(int j = k; j < 80; ++j)
                                std::cout << c[79 - j];
                else
                        std::cout << 0;
                std::cout << std::endl;
        }
        return 0;
}

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

char iota(int n){
  switch (n) {
    case 0: return '0';
    case 1: return '1';
    case 2: return '2';
    case 3: return '3';
    case 4: return '4';
    case 5: return '5';
    case 6: return '6';
    case 7: return '7';
    case 8: return '8';
    case 9: return '9';
  }
  return '0';
}

int main(){

  std::string num1;   //("10000");
  std::string num2;   //("990000");
  char sum[100]={};
  int n,i,j,flag=0,temp;

  std::cin >> n;
  //n=1;

  for(i=0;i<n;i++){
    for(j=0;j<100;j++){
      sum[j]='\0';
    }
    std::cin >> num1 >> num2;
    if(num1.size()<num2.size()){
      num1.swap(num2);
    }
    //std::cout << num1 << std::endl;
    //std::cout << num2 << std::endl;
    for(j=0;j<num1.size();j++){
      if(j<num2.size()){
        temp = (num1[num1.size()-j-1]-'0')+(num2[num2.size()-j-1]-'0');
      }
      if(j>=num2.size()){
        temp = num1[num1.size()-j-1]-'0';
      }
      if(flag){
      ++temp;
      flag = 0;
      }
      if(temp>9){
        temp -= 10;
        flag = 1;
      }
      sum[j] = iota(temp);
    }
    if(flag){
      sum[j] = '1';
      flag = 0;
    }
    //printf("%s\n",sum);
    j=0;
    while(sum[j]!='\0'){
      ++j;
    }
    //std::cout << j <<std::endl;
    if(j>80){
      std::cout << "overflow" << std::endl;
    }else{
      while(j>0){
        printf("%c",sum[j-1]);
        --j;
      }
      std::cout << std::endl;
    }
  }
}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <climits>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <vector>
#include <queue>
#include <string>
#include <complex>
using namespace std;

#define rep(i,n) for(int i=0; i<n; i++)
#define repa(i,s,e) for(int i=s; i<=e; i++)
#define repd(i,s,e) for(int i=s; i>=e; i--)

typedef vector<int> vi;

int n;
string s1, s2;
char n1[80], n2[80], sum[80];

int main() {
	scanf("%d", &n);
	rep(i,n) {
		memset(n1, 0, sizeof(n1));
		memset(n2, 0, sizeof(n2));
		memset(sum, 0, sizeof(sum));

		cin>>s1>>s2;
		int l1 = s1.size();
		int l2 = s2.size();
		if(max(l1,l2) > 80) {
			printf("overflow\n");
			return 0;
		}

		rep(k,l1) n1[k] = s1[l1-k-1] - '0';
		rep(k,l2) n2[k] = s2[l2-k-1] - '0';

		char a = 0;
		rep(i,80) {
			char c = n1[i] + n2[i] + a;
			a = c / 10;
			sum[i] = c % 10;
		}

		if(a != 0) {
			printf("overflow\n");
			return 0;
		}

		bool start = false;
		repd(i,79,0) {
			if(sum[i] != 0) start = true;
			if(!start && sum[i] == 0) continue;
			printf("%d", sum[i]);
		}
		if(!start) printf("0");
		printf("\n");
	}
}

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

using namespace std;

int main() {
    int n;
    cin >> n;
    while (n--) {
        int len, keta = 0;
        string a, b, c = "";
        cin >> a >> b;
        reverse(a.begin(), a.end());
        reverse(b.begin(), b.end());
        len = max(a.size(), b.size());
        for (int i = 0, size = len - a.size(); i < size; i++) {
            a += '0';
        }
        for (int i = 0, size = len - b.size(); i < size; i++) {
            b += '0';
        }
        for (int i = 0; i < len; i++) {
            c += ((a[i] - '0') + (b[i] - '0') + keta) % 10 + '0';
            keta = ((a[i] - '0') + (b[i] - '0') + keta) / 10;
        }
        if (keta == 1) {
            c += '1';
        }
        reverse(c.begin(), c.end());
        if (c.size() > 80) {
            cout << "overflow\n";
        }
        else {
            cout << c << endl;
        }
    }
    
    return 0;
}

C++: #include <stddef.h>
#include <algorithm>
#include <iostream>
#include <iterator>
#include <string>
 
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s1, s2, s3 = "";
    cin >> s1 >> s2;
    size_t m = max(s1.size(), s2.size());
    while (s1.size() < m)
      s1.insert(s1.begin(), '0');
    while (s2.size() < m)
      s2.insert(s2.begin(), '0');
    char c = 0;
    auto it1 = s1.rbegin();
    auto it2 = s2.rbegin();
    for (; it1 != s1.rend(); it1++, it2++) {
      char add = *it1 - '0' + *it2 - '0' + c;
      char ch = add % 10 + '0';
      c = add / 10;
      s3.insert(s3.begin(), ch);
    }
    if (c) s3.insert(s3.begin(), c + '0');
    cout << ((s3.size() > 80) ? "overflow" :s3) << endl;
  }
}