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 <vector>
#include<string>
#include<sstream>
#define CAPACITY 9


namespace stoi{//stoi?????¨?????????????????????????????????????????§??£?¨???????

	int stoi(std::string str){
		int ret;
		std::stringstream ss;
		ss << str;
		ss >> ret;
		return ret;
	}

}
class OverDigit{

public:

	int num_a[CAPACITY];
	int num_b[CAPACITY];
	OverDigit(std::string str_a, std::string str_b);
	void ChangeDigit(std::string str, int num[]);
	void Add();
};

OverDigit::OverDigit(std::string str_a, std::string str_b){

	ChangeDigit(str_a, num_a);
	ChangeDigit(str_b, num_b);

}

void OverDigit::ChangeDigit(std::string str, int num[]){

	std::vector <int> num_str(CAPACITY, 0);
	int loc = CAPACITY, k = 8;
	int  str_rest;

	str_rest = str.length() % CAPACITY;

	for (int j = str.length() - CAPACITY; j > 0; j = j - CAPACITY){
		num_str[k] = stoi::stoi(str.substr(j, CAPACITY));
		loc = k;
		k--;

	}
	//?????????????????????????????????????????\??????

	if (str_rest != 0)num_str[loc - 1] = stoi::stoi(str.substr(0, str_rest));

	for (int j = 0; j < CAPACITY; j++){
		num[j] = num_str[j];
	}
}
//80????????§????¶???????
void OverDigit::Add(){

	int num_ans[CAPACITY] = {};
	int fat, overflow = 0, count = 0;

	for (int j = CAPACITY - 1; j >0; j--){
		if (num_a[j] + num_b[j] <= 999999999){
			num_ans[j] = num_a[j] + num_b[j];
		}
		else if (num_a[j] + num_b[j] > 999999999){
			fat = (num_a[j] + num_b[j]) - 1000000000;
			num_ans[j] = fat;
			num_a[j - 1]++;
		}

	}

	if (num_a[0] + num_b[0] > 99999999){
		overflow = 1;
	}
	else{
		num_ans[0] = num_a[0] + num_b[0];


	}

	if (overflow == 1){
		std::cout << "overflow" << std::endl;
	}
	else {
		for (int j = 0; j < CAPACITY; j++){
			if (num_ans[j] != 0){
				count++;
				std::cout << num_ans[j];

			}
			else if (num_ans[j] == 0 && count >= 1){
				std::cout << "000000000";
			}

		}std::cout << std::endl;
	}

};


int main(){


	//vector???????????¨??????80???????¨????
	int N;
	std::string str_a, str_b;

	std::cin >> N;
	std::cin.ignore();

	for (int i = 0; i < N; i++){
		getline(std::cin, str_a);
		getline(std::cin, str_b);
		if (str_a == "0" && str_b == "0"){std::cout << 0 << std::endl;
		}
		else{

			OverDigit OverDigit_a(str_a, str_b);//???????????§??????
			OverDigit_a.Add();
		}
	}
	return 0;
}

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

int main(){


  string strx,stry;
  int N;
  cin >> N;
  while(N){

    cin >> strx;
    cin >> stry;

    int x[30] = {0},y[30] = {0};
    int i,lenx = strx.size(), leny = stry.size();
    string tmp;
    
    for( i = 0; lenx > 5 ; i++){
      tmp = strx.substr(lenx - 5);
      x[i] = atoi(tmp.c_str());
      strx =  strx.substr(0,lenx - 5);
      lenx -= 5;
    }
    x[i] = atoi(strx.c_str());
    for( i = 0; leny > 5 ; i++){
      tmp = stry.substr(leny - 5);
      y[i] = atoi(tmp.c_str());
      stry =  stry.substr(0,leny - 5);
      leny -= 5;
    }
    y[i] = atoi(stry.c_str());
    
    
    int ans[20] = {0};
    for(i = 0 ; i < 20 ; i++){
      ans[i] += x[i] + y[i];
      if(ans[i] > 99999){
	ans[i+1] += 1;
	ans[i] -= 100000;
      }
    }
    if(ans[16] != 0)
      cout << "overflow"<< endl;
    else{
      for(i = 16; i >= 0 ; i--){
	if(ans[i] != 0)
	  break;
      }
      if(i >= 0){ 
	cout << ans[i];	
	for(i = i-1; i >= 0 ; i--){
	  if(ans[i] < 10) cout << "0";
	  if(ans[i] < 100) cout << "0";
	  if(ans[i] < 1000) cout << "0";
	  if(ans[i] < 10000) cout << "0";
	  cout << ans[i];
	}
	cout << endl;
      }
      else cout << "0" << endl;
    }
    
    N--;
  }
  return 0;
}

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

using namespace std;

int main (void) {
    int N;
    cin >> N;
    while (N--) {
        string s1, s2;
        cin >> s1;
        cin >> s2;
        vector<int> n1, n2, res;
        for (int i = s1.size(); i--;) {
            n1.push_back((int)(s1[i] - '0'));
        }
        for (int i = s2.size(); i--;) {
            n2.push_back((int)(s2[i] - '0'));
        }
        if (n1.size() < n2.size()) {
            for (int i = n1.size(); i < n2.size(); i++) {
                n1.push_back(0);
            }
        } else if (n2.size() < n1.size()) {
            for (int i = n2.size(); i < n1.size(); i++) {
                n2.push_back(0);
            }
        }
        int s, c = 0;
        for (int i = 0; i < n1.size(); i++) {
            s = n1[i] + n2[i] + c;
            res.push_back(s % 10);
            c = s / 10;
        }
        if (c != 0) {
            res.push_back(c);
        }
        if (res.size() > 80) {
            cout << "overflow" << endl;
        } else {
            int i = res.size();
            while (res[i - 1] == 0) {
                i--;
            }
            while (i--) {
                cout << res[i];
            }
            cout << endl;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;
int main(){
	int N;
	string x, y, temp;
	int i, a[80];

	cin >> N;

	for(i = 0;i < 80;i++){
		a[i] = 0;
	}

	while(N != 0){
		if(N == 0) break;
		cin >> x >> y;

		if(x.size() > 80 || y.size() > 80){
			cout << "overflow" << endl;
		}

		if(x.size() < y.size()){
			temp = x;
			x = y;
			y = temp;
		}
		int xi = 0, yi = 0, sum = 0;
		for(i = 0;i < x.size();i++){
			xi = x[x.size() - 1 - i] - '0';
			//cout << "xi = " << xi << endl;
			if(i >= y.size()){
				yi = 0;
			}
			else {
				yi = y[y.size() - 1 - i] - '0';
				//cout << "yi = " << yi << endl;
			}
			a[i] += xi + yi;
			//cout << "xi + yi  = " << a[x.size() - 1 - i] << endl;
			if(a[i] > 9){
				if(i < 79){
					a[i] = a[i] - 10;
					a[i + 1] += 1;
				}
				else if(i >= 79){
					cout << "overflow"	<< endl;				
				}
			}

			
		}
		bool start = false;
		for(i = 79;i >= 0;i++){
			if(!start && a[i] > 0){
				start = true;
			}
			else if(start){
				cout << a[i];
			}
		}
		cout << endl;
		for(i = 0;i < 80;i++){
				a[i] = 0;
		}
		N--;
	}
	return 0;
}