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 <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>

#define MAX_LEN (80)
#define OVERFLOW std::cout << "overflow" << std::endl;

class LargeInteger {
public:
  LargeInteger();
  LargeInteger(const std::string& val);
  ~LargeInteger();

  void operator=(const std::string& val);
  const LargeInteger& operator+(const LargeInteger& other);

  const std::string& GetVal() const;

  friend std::istream& operator >> (std::istream& is, LargeInteger& obj);
private:
  std::string m_val;
};

LargeInteger::LargeInteger()
{
  ;
}

LargeInteger::LargeInteger(const std::string& val) : m_val(val)
{
  ;
}

LargeInteger::~LargeInteger()
{
  ;
}

void LargeInteger::operator=(const std::string& val)
{
  m_val = val;
}

const LargeInteger& LargeInteger::operator+(const LargeInteger& other)
{
  std::string l = m_val;
  std::string s = other.GetVal();

  if (l.size() != s.size()) {
    if (l.size() < s.size()) std::swap(l, s);
    int diff = l.size() - s.size();
    std::string pad;
    for (int i = 0; i < diff; i++) pad.push_back('0');
    s = pad + s;
  }

  std::vector<int> sum_digits;

  int adv = 0;
  for (int i = l.size() - 1; i >= 0; i--) {
    int d_l = static_cast<int>(l.at(i) - '0');
    int d_s = static_cast<int>(s.at(i) - '0');
    int sum = d_l + d_s + adv;
    adv = sum >= 10 ? 1 : 0;
    sum_digits.push_back(sum % 10);
  }

  std::stringstream sstr;
  if (adv) sstr << 1;
  for (int i = sum_digits.size() - 1; i >= 0; i--) sstr << sum_digits.at(i);
  m_val = sstr.str();

  return *this;
}

const std::string& LargeInteger::GetVal() const
{
  return m_val;
}

std::istream& operator >> (std::istream& is, LargeInteger& obj)
{
  is >> obj.m_val;
  return is;
}

int main(void)
{
  int set_num = 0;
  std::cin >> set_num;

  for (int i = 0; i < set_num; i++) {
    LargeInteger li_1, li_2;

    std::cin >> li_1;
    std::cin >> li_2;

    if (li_1.GetVal().size() > MAX_LEN || li_2.GetVal().size() > MAX_LEN) {
      OVERFLOW;
      continue;
    }

    LargeInteger li_sum = li_1 + li_2;
    if (li_sum.GetVal().size() > MAX_LEN) {
      OVERFLOW;
    }
    else {
      std::cout << li_sum.GetVal() << std::endl;
    }
  }

  return 0;
}

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

using namespace std;

int main(){
    
    string d;
    string e;

    stack<char> st1;
    stack<char> st2;
    stack<int> st3;
    int n=0;
    scanf("%d",&n);

    for(int i=0; i<n; i++){
        cin>>d;
        cin>>e;
        
        if((int)(d.size())>80||(int)(e.size())>80){
            printf("overflow");
        }else{
            for(int j=0; j<(int)(d.size()); j++){
                st1.push(d[j]);
            }
            for(int j=0; j<(int)(e.size()); j++){
                st2.push(e[j]);
            }
            int temp=0;
            char temp_char;
            while(st1.empty()==false||st2.empty()==false){
                if(st1.empty()==false&&st2.empty()==false){
                    temp_char=st1.top();
                    temp+=atoi(&temp_char);
                    temp_char=st2.top();
                    temp+=atoi(&temp_char);
                    st1.pop();
                    st2.pop();
                }else if(st1.empty()==false&&st2.empty()==true){
                    temp_char=st1.top();
                    temp+=atoi(&temp_char);
                    st1.pop();
                }else if(st1.empty()==true&&st2.empty()==false){
                    temp_char=st2.top();
                    temp+=atoi(&temp_char);
                    st2.pop();
                }
                st3.push(temp%10);
                temp=temp/10;
            }
            
            if(temp!=0){
                st3.push(temp);
            }
            
            if(st3.size()>80){
                printf("overflow");
            }else{
                while(st3.empty()==false){
                    printf("%d",st3.top());
                    st3.pop();
                }
            }
            
        }
        printf("\n");
    }
    
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>

const int MAX_SIZE = 90;

#define toI(x) (x-'0')

using namespace std;

class Z
{
private:
  int size;
  char d[MAX_SIZE];
public:
  Z(char *s)
  {
    size = strlen(s);
    for(int i=0;i<MAX_SIZE - size;i++)
      d[i] = 0;
    for(int i=0,j=MAX_SIZE - size;j < MAX_SIZE; i++, j++)
      d[j] = s[i];
  }

  void add(Z r)
  {
    int tmp = max(this->size, r.size);
    int updigit = 0;
    for(int i=MAX_SIZE-1;i>=0;i--){
      int a = 0, b = 0;
      if(this->d[i] == 0&& r.d[i] == 0){
	if(!updigit)
	  goto end;
	this->d[i] = updigit+'0';
	updigit = 0;
	tmp++;
      }else{
	if(this->d[i])
	  a = toI(this->d[i]);
	if(r.d[i])
	  b = toI(r.d[i]);
	int n = a + b + updigit;
	updigit = n / 10;
	this->d[i] = (n % 10)+'0';
      }
    }
  end:
    this->size = tmp;
    return;
  }

  void print()
  {
    if(this->size > 80){
      puts("overflow");
      return;
    }
    for(int i=0;i<MAX_SIZE;i++)
      if(d[i] != -1)
	putchar(d[i]);
    puts("");
  }

  int sz()
  {
    return this->size;
  }
};

int main()
{
  /*  int x;
  scanf("%d", &x);
  char s1[MAX_SIZE], s2[MAX_SIZE];  
  for(int i=0;i<x;i++){
    scanf("%s%s",s1, s2);
    Z z1(s1);
    Z z2(s2);
    if(z1.sz() > 80 || z2.sz() > 80){
      puts("overflow");
      continue;
    }
    z1.add(z2);
    z1.print();*/
  }
  return 0;
}

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

int main(void){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		string a,b,ans;
		cin >> a;
		cin >> b;
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());
		int c=0;
		for(int j=0;j<max(a.size(),b.size());j++){
			string d;
			int e;
			e=c;
			if(a.size()>j)e+=a[j]-'0';
			if(b.size()>j)e+=b[j]-'0';
			c=0;
			if(e>=10)c=1,e-=10;
			d=e+'0';
			ans+=d;
		}
		if(c==1)ans+=c+'0';
		reverse(ans.begin(),ans.end());
		if(ans.size()<=80)cout << ans << endl;
		else cout << "overflow" << endl;
	}
    return 0;
}

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

int main(){
  int n;
  string s1,s2,ans;
  cin >> n;
  
  for(int i=0; i<n; i++){
    cin >> s1; 
    cin >> s2;
    ans = "";
    reverse(s1.begin(),s1.end());
    reverse(s1.begin(),s2.end()); //反転
    int m = max(s1.size(),s2.size());
    while(m>s1.size()) s1+='0';
    while(m>s2.size()) s2+='0';

    int carry = 0;
    for(int j=0; j<m; j++){
      char ch = ((s1[j]-'0') + (s2[j]-'0') + carry)%10 + '0';
      carry = ((s1[j]-'0') + (s2[j]-'0') + carry)/10;
      ans += ch;
    }
    if(carry) ans+=(carry+'0');
    reverse(ans.begin(),ans.end()); //元通り

    //頭の0を削除していく
    while(ans.size()>1 && ans[0] == '0') ans.erase(ans.begin());
    if(ans.size() > 80) cout << "overflow" << endl;
    else cout << ans << endl;
  }
  return 0;
}