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>
     
    class BigInteger {
    	// use 18 digit a element
    	std::vector<uint64_t> splited_num_;
    public:
    	BigInteger(std::string str) {
    		set_data(str);
    	}
    	BigInteger(std::vector<uint64_t>&& splited_num) {
    		splited_num_ = std::move(splited_num);
    	}
    	BigInteger operator+(const BigInteger& rhs) {
    		return BigInteger(plus(splited_num_, rhs.get_data()));
    	}
    	std::vector<uint64_t> get_data() const {return splited_num_;}
    	std::string to_string() const {
    		std::string ret;
    		const int size = splited_num_.size();
    		for (int i = 0; i < size; ++i) {
    			const int& n = splited_num_[size - i - 1];
    			ret += n == 0 ? "000000000000000000" : std::to_string(n);
    		}
    		return ret;
    	}
    private:
    	void set_data(const std::string& str) {
    		std::string sub;
    		int length = str.length();
    		while (length >= 18) {
    			int pos = length - 18;
    			sub = str.substr(pos, 18);
    			splited_num_.push_back(to_uint64(sub));
    			length -= 18;
    		}
    		if (length > 0) {
    			sub = str.substr(0, length);
    			splited_num_.push_back(to_uint64(sub));
    		}
		}
    	std::vector<uint64_t> plus(std::vector<uint64_t> lhs,
    						       std::vector<uint64_t> rhs) const {
    		std::vector<uint64_t> ret;
     		uint64_t carry = 0;
     		
     		const int max = std::max(lhs.size(), rhs.size());
     		const int min = std::min(lhs.size(), rhs.size());
     		// ensure that lhs.sizs() is larger than rhs.size()
     		if (lhs.size() < rhs.size()) {
     			std::swap(lhs, rhs);
     		}
     		// fit container size
     		for (int i = 0; i < (max - min); ++i) {
     			rhs.push_back(0);
     		}
     		
     		for (int i = 0; i < max; ++i) {
     			uint64_t sum = lhs.at(i) + rhs.at(i) + carry;
     			carry = sum / 1000000000000000000;
     			sum = sum % 1000000000000000000;
     			ret.push_back(sum);
     		}
     		if (carry > 0) {
     			ret.push_back(carry);
     		}
     		return ret;
    	}
    	uint64_t to_uint64(const std::string& str) const {
    		std::istringstream iss(str);
    		uint64_t ret = 0;
    		iss >> ret;
    		return ret;
    	}
    };
     
    int main() {
    	std::vector<BigInteger> ans_list;
    	int n;
    	std::cin >> n;
    	for (int i = 0; i < n; ++i) {
    		std::string str1, str2;
    		std::cin >> str1;
    		std::cin >> str2;
    		BigInteger bi1(str1);
    		BigInteger bi2(str2);
    		ans_list.push_back(bi1 + bi2);
    	}
    	
    	for (auto ans : ans_list) {
    		std::cout << ans.to_string() << std::endl;
    	}
    }

C++: #include <iostream>
#include <string>
using namespace std;
int main( void )
{
  int i,k,n;
  string s1,s2;
  int d1[82],d2[82],d3[82];
  cin >> n;
  for( k=0; k<n; k++ ){
    cin >> s1 >> s2;
    if( s1.size() > 80 || s2.size() > 80 ){
      cout << "overflow" << endl;
      continue;
    }
    for( i=0; i<s1.size(); i++ ) d1[i] = s1[s1.size()-i-1] - '0';
    for( i=s1.size(); i<80; i++ ) d1[i] = 0;
    for( i=0; i<s2.size(); i++ ) d2[i] = s2[s2.size()-i-1] - '0';
    for( i=s2.size(); i<80; i++ ) d2[i] = 0;
    d3[0]=0;
    for( i=0; i<80; i++ ){
      d3[i] += d1[i] + d2[i];
      if( d3[i] >= 10 ){ d3[i] %= 10; d3[i+1]=1; }
      else d3[i+1]=0;
    }
    i=80;
    if( d3[i] > 0 ){
      cout << "overflow" << endl;
      continue;
    }
    while( i > 0 && d3[--i] == 0 )
      ;
    while( i >= 0 ) cout << d3[i--];
    cout << endl;
  }
  return 0;
}

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

using namespace std;

void sum80(int* a, int* b);
int get80(string str, int* num);

int main(void){
	string a80, b80;
	int a[81], b[81];
	int i, N;
	cin>>N;
	i=0;
	while(i<N){
		cin>>a80;
		cin>>b80;
		if(get80(a80, a)<0 || get80(b80, b)<0){
			cout<<"overflow"<<endl;
		}else{
			sum80(a, b);
		}
		i++;
	}
	return 0;
}

int get80(string str, int* num){
	int d=str.length();
	if(d<=80){
		for(int i=0; i<d; i++){
			num[i]=str[d-1-i]-'0';
		}
		for(int i=d;i<81; i++){
			num[i]=0;
		}
		return d;
	}else{
		return -1;
	}

}

void sum80(int* a, int* b){
	int s[81], amari;
	amari=0;
	for(int i=0; i<81; i++){
		s[i]=(a[i]+b[i]+amari)%10;
		if(a[i]+b[i]+amari>=10){
			amari=1;
		}else{
			amari=0;
		}
	}
	if(s[80]!=0){
		cout<<"overflow"<<endl;
	}else{
		bool flag=false;
		for(int i=79; i>=0; i--){
			if(flag==true || s[i]!=0){
				flag=true;
				cout<<s[i];
			}
		}
		cout<<endl;
	}
}

C++: #include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
#define FILL(ptr, value) FILL_((ptr), sizeof(ptr)/sizeof(value), (value))
template <typename T>
void FILL_(void * ptr, size_t size, T value){
  std::fill((T*)ptr, (T*)ptr+size, value);
}
//4方向ベクトル→↑←↓
int dx[] ={1,0,-1,0};
int dy[] ={0,-1,0,1};
int n;
int main()
{
  scanf("%d",&n);
  for(int i = 0;i < n;i++){
    string str1;
    string str2;
    string str3;
    cin>>str1>>str2;
    int size =max(str1.size(),str2.size());
    while(str1.size()<size)
      str1 ='0'+str1;
    while(str2.size()<size)
      str2 ='0'+str2;
    int c = 0;//桁上り
    for(int j = size-1;j >=0;j--){
      char ch = ((str1[j]-'0')+(str2[j]-'0')+c)%10+'0';
      c =((str1[j]-'0')+(str2[j]-'0')+c)/10;
      str3 =ch+str3;
  }
    if(c){
      char cs =c+'0';
      str3 = cs+str3;
    }
    while(str3.size()>1 &&str3[0] =='0')
      str3.erase(str3.begin());
    if(str3.size() >80)
      cout <<"overflow"<<endl;
    else
      cout <<str3<<endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)

vector<int> a(200);
vector<int> b(200);
vector<int> comp(200);

void dfs(int i){
	//i?????????1?¶????
	if (comp[i]<9){
		comp[i]++;
	}
	else{
		comp[i]=0;
		dfs(i+1);
	}
}

int main(){
	int N;
	cin>>N;
	REP(i,N){
		string s1,s2;
		REP(j,200){
			comp[j]=b[j]=0;
		}
		cin>>s1;
		cin>>s2;
		REP(j,s1.size()){
			comp[j]=s1[s1.size()-j-1]-'0';
		}
		REP(j,s2.size()){
			b[j]=s2[s2.size()-j-1]-'0';
		}
		REP(j,s2.size()){
			comp[j]+=b[j];
			if (comp[j]>9){
				comp[j]-=10;
				dfs(j+1);
			}
		}
		int fl=200-1;
		while(!comp[fl]) fl--;
		fl++;
		if (fl>80){
			cout<<"overflow"<<endl;
		}
		else{
			for(int k=fl-1;k>=0;k--){
				cout<<comp[k];
			}
			cout<<endl;
		}
	}
	return 0;
}