Go: package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	const maxCapacity = 512 * 1024
	buf := make([]byte, maxCapacity)
	scanner.Buffer(buf, maxCapacity)

	n := nextInt()
	maxint, _ := new(big.Int).SetString("100000000000000000000000000000000000000000000000000000000000000000000000000000000", 10)

	for i := 0; i < n; i++ {
		aStr := nextString()
		bStr := nextString()

		a, _ := new(big.Int).SetString(aStr, 10)
		b, _ := new(big.Int).SetString(bStr, 10)
		c := big.NewInt(0).Add(a, b)

		if c.Cmp(maxint) < 0 {
			fmt.Println(c)
		} else {
			fmt.Println("overflow")
		}
	}
}

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

std::string add(std::string,std::string);

int main(){
  std::string n,m;
  int size;
  std::cin>>size;
  std::vector<std::string> sums;
  for(int i=0;i<size;++i){
    std::cin>>n>>m;
    std::string sum = add(n,m);
    if(sum.length()<=80)
      sums.push_back(sum); 
    else
      sums.push_back("overflow"); 
  }

  for(auto s:sums)
    std::cout<<s<<std::endl;

  return 0;
}

std::string add(std::string n,std::string m){
  if(n.length()>m.length()) std::swap(n,m);
  std::reverse(n.begin(),n.end());
  std::reverse(m.begin(),m.end());
  std::string sum;
  char c=0,s,t;
  for(int i=0;i<m.length()||c==1;++i){
    t = (i<n.length()?n[i]-'0':0)+(i<m.length()?m[i]-'0':0)+c;
    s = t%10;
    c = t/10;
    sum.push_back(s+'0');
  }
  
  std::reverse(sum.begin(),sum.end());
  sum.push_back('\0');
  return sum;
}

C++: #include<iostream>
#include<algorithm>
#include<sstream>
#include<string>
using namespace std;
int main(){
	int n;
	for(cin>>n;n--;){
		string a,b;
		cin>>a;
		cin>>b;
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());
		while(a.size()<b.size())a+='0';
		while(b.size()<a.size())b+='0';
		a+='0';
		int f=0;
		for(int i=0;i<a.size()-1;i++){
			if((a[i]-'0')+(b[i]-'0')+f>9){
				a[i]=(a[i]-'0')+(b[i]-'0')+f-10;
				f=1;
			}else{
				a[i]=(a[i]-'0')+(b[i]-'0');
				f=0;
			}
			a[i]+='0';
		}
		reverse(a.begin(),a.end());
		if(f)a[0]='1';
		if(a.size()>80){
			cout<<"over flow"<<endl;
		}else{
			for(int i=0;i<a.size();i++){
				if(a[i]!='0' || i!=0)
				cout<<a[i];
			}
			cout<<endl;
		}
	}
	return 0;
}

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

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

  int n; cin >> n;
  for(int i=0;i<n;i++) {
    string s1,s2;
    cin >> s1;
    cin >> s2;
    int s1_itr = s1.length() - 1;
    int s2_itr = s2.length() - 1;
    bool is_shift = false;
    int digit;
    vector<int> sum;
    while(s1_itr >= 0 || s2_itr >= 0) {
      digit = 0;
      if(s1_itr >= 0)
        digit += s1[s1_itr] - '0';
      if(s2_itr >= 0)
        digit += s2[s2_itr] - '0';
      if(is_shift)
        digit += 1;

      if(digit >= 10) {
        is_shift = true;
        digit = digit - 10;
      }
      else {
        is_shift = false;
      }
      sum.push_back(digit);
      s1_itr--;
      s2_itr--;
    }
    if(is_shift)
      sum.push_back(1);

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

C++: #include <bits/stdc++.h>
using namespace std;

#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false

int main()
{
    int n;
    cin >> n;
    rep(i, n)
    {
        char temp;
        stack<int> as, bs, cs;
        string a, b;
        cin >> a >> b;
        rep(j, a.length()) as.push(a[j] - '0');
        rep(j, b.length()) bs.push(b[j] - '0');
        int keta = max(as.size(), bs.size());
        int aa, bb, cc = 0;
        rep(j, keta)
        {
            if (as.size() != 0)
            {
                aa = as.top();
                as.pop();
            }
            else
            {
                aa = 0;
            }

            if (bs.size() != 0)
            {
                bb = bs.top();
                bs.pop();
            }
            else
            {
                bb = 0;
            }
            int hoge = aa + bb + cc;
            cc = hoge / 10;
            cs.push(hoge - 10 * cc);
        }
        if (cc != 0)
        {
            cs.push(cc);
        }
        if (cs.size() > 80)
        {
            cout << "overflow";
            if(DEBUG) cout<<cs.size();
        }
        else
        {
            while (cs.size() != 0)
            {
                cout << cs.top();
                cs.pop();
            }
        }
        cout << endl;
    }
    return 0;
}