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 n;
  cin >>n;
  while(n--){
    string a,b,ans;
    cin >>a>>b;
    int as = a.size(), bs = b.size(), ms = (as>bs)? as:bs,t=0;
    for(int i=0; i<ms; i++){
      if(i<as && i<bs){t = a[as-i-1]+b[bs-i-1]+t/10-2*'0';}
      else if(i<as){t = a[as-i-1]+t/10-'0';}
      else if(i<bs){t = b[bs-i-1]+t/10-'0';}
      ans+=(char)(t%10)+'0';
    }
    if(t/10){ans+='1';}
    if(ans.size()>=80){cout <<"over flow"<<endl;}
    else{for(int i=0; i<ans.size(); i++){cout <<ans[ans.size()-i-1];}cout <<endl;}
  }
  return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstdint>
#include <cstring>
#include <cctype>
#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <functional>
#include <stdexcept>
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
const double PI = 3.141592653589793238462643383279502884L;
const int LARGE_INT = 1000000007;
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define tr(c, i) for(auto i = (c).begin(); i != (c).end(); i++)
#define rtr(c, i) for(auto i = (c).rbegin(); i != (c).rend(); i++)
#define repfn(i,a,cont,next) \
  for(auto i = (a); [=](){return(cont);}(); i = [=](){return(next);}())
#define repby(i,a,b,s) repfn(i,a,i<b,i+s)
#define repab(i,a,b) repby(i,a,b,1)
#define rep(i,b) repab(i,0,b)
#define pb push_back
#define sz(c) int((c).size())

typedef vector<int> bignum;
const int max_digit = 80;

bignum operator+(const bignum& lhs, const bignum& rhs)
{
  int tmp, carry = 0;
  bignum res(max_digit, 0);
  for (int i = 0; i < max_digit; i++) {
    tmp = lhs[i] + rhs[i] + carry;
    if (tmp > 9) {
      carry = 1;
      res[i] = tmp % 10;
    } else {
      carry = 0;
      res[i] = tmp;
    }
  }
  if (carry)
    throw runtime_error("overflow");
  return res;
}

ostream& operator<<(ostream& os, const bignum& rhs)
{
  bool skip = true;
  rtr(rhs, i) {
    if (*i == 0 && skip)
      continue;

    skip = false;
    os << *i;
  }
  return os;
}

istream& operator>>(istream& is, bignum& rhs)
{
  string s;
  int i = 0;
  is >> s;
  rhs.assign(max_digit, 0);
  for (auto p = s.rbegin(); p != s.rend(); p++, i++) {
    if (i >= max_digit)
      throw runtime_error("overflow");
    rhs[i] = *p - '0';
  }
  return is;
}

int main(int argc, char **argv)
{
  int n;
  bignum a, b;
  string tmp;

  cin >> n;
  while (n--) {
    try {
      cin >> a;
    } catch (runtime_error& re) {
      cout << re.what() << endl;
      cin >> tmp;
      continue;
    }
    try {
      cin >> b;
    } catch (runtime_error& re) {
      cout << re.what() << endl;
      continue;
    }
    try {
      cout << (a + b) << endl;
    } catch (runtime_error& re) {
      cout << re.what() << endl;
    }
  }
  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<algorithm>
#include<cstdlib>
using namespace std;
typedef long long int ll;

int main()
{
	int n;
	cin >> n;
	for(int i=0;i<n;i++){
		int a[80];
		string sa1,sa2,s1="",s2="";
		for(int i=0;i<80;i++)a[i]=0;
		cin >> sa1 >> sa2;
		for(int j=0;j<80-sa1.length();j++){
			s1+='0';
		}
		s1+=sa1;
		for(int j=0;j<80-sa2.length();j++){
			s2+='0';
		}
		s2+=sa2;
		for(int i=0;i<80;i++){
			a[i]+=(s1[i]-'0')+(s2[i]-'0');
		}
		for(int i=79;i>=1;i--){
			a[i-1]+=a[i]/10;
			a[i]%=10;
		}
		if(a[0]>=10){
			printf("overflow\n");
			continue;
		}
		int x=0;
		while(a[x]==0)x++;
		for(int i=x;i<=79;i++){
			cout << a[i];
		}
		if(x==80)printf("0\n");
		else printf("\n");
	}
    return 0;
}

C++: #include "bits/stdc++.h"

#define debug(x) cout<<#x<<": "<<x<<endl
#define rep(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a);i<=(b);i++)
#define all(a) (a).begin(),(a).end()
using namespace std;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef long long ll;
ll gcd(ll a, ll b) {
	ll c;
	while (a != 0) {
		c = a; a = b%a;  b = c;
	}
	return b;
}

void solve() {
#ifdef _WIN32
	istream &cin = ifstream("input.txt");
#endif
	int n;
	cin >> n;
	rep(i, n) {
		vector<ll> v1(11), v2(11);
		string s1, s2;
		cin >> s1 >> s2;
		rep(j, 10) {
			if (s1.size() > 10 * j) v1[j] = stoi(s1.substr(10 * j, min(10u, s1.size() - 10 * j)));
			if (s2.size() > 10 * j) v2[j] = stoi(s2.substr(10 * j, min(10u, s2.size() - 10 * j)));
		}
		rep(j, 11) {
			v1[j] += v2[j];
			if (v1[j] >= 1e10) {
				v1[j] -= 1e10;
				v2[j]++;
			}
		}
		if (v1[8] || v1[9] || v1[10]) cout << "overflow" << endl;
		else {
			rep(j, 11) if (v1[10 - j] != 0) cout << v1[10 - j];
			cout << endl;
		}
	}

}




int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);


	solve();
	system("PAUSE");
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	string a,b,c;
	int n;
	cin>>n;
	for(int fjal=0;fjal<n;fjal++){
	cin>>a>>b;
	c.clear();
	if(a.size()<b.size())swap(a,b);
	int as=a.size();
	while(as!=b.size())b="0"+b;
	//cout<<a<<" "<<b;
	bool kuri=false;
	for(int i=as-1;i>=0;i--){
		int _a=a[i]-'0',_b=b[i]-'0',ans=_a+_b;
		if(kuri)ans++;
		if(ans>=10){
			kuri=true;
			ans-=10;
		}
		else {kuri=false;}
		c.push_back(ans+'0');
	}
		if(kuri)c.push_back('1');
	
		if(c.size()<80){for(int i=c.size()-1;i>=0;i--)cout<<c[i];
		cout<<endl;
		}
		else cout<<"overfllow"<<endl;
	}
	return 0;
}

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

using namespace std;

string hissan(string a, string b) {
    if (a.size() < b.size()) a.swap(b);
    int bi = b.size() - 1;
    int c = 0;
    string ans;

    for (int i = a.size() - 1; i >= 0; i--) {
        int _a = a[i] - '0';
        int _b = (bi >= 0) ? b[bi--] - '0' : 0;
        int x = _a + _b + c;

        if (x < 10) {
            c = 0;
        }
        else {
            x -= 10;
            c = 1;
        }
        ans.insert(0, to_string(x));
    }

    if (c) ans.insert(0, "1");

    return ans;
}

int main()
{
    int n;
    string a, b;

    cin >> n;
    while(n--) {
        cin >> a;
        cin >> b;
        string x = hissan(a, b);
        cout << ((x.size() > 80) ? "overflow" : x) << endl;
    }
    return 0;
}