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 uint64_t& 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;

string calc(string s1,string s2){
  int num1=s1.size()-1,num2=s2.size()-1;
  int tmp=0;
  string s;
  while(!(num1==-1&&num2==-1&&tmp==0)){
    if(num1!=-1&&num2!=-1){
      tmp+=int(s1[num1]-'0')+int(s2[num2]-'0');
      num1--;num2--;
    }else if(num1!=-1&&num2==-1){
      tmp+=int(s1[num1]-'0');
      num1--;
    }else if(num1==-1&&num2!=-1){
      tmp+=int(s2[num1]-'0');
      num2--;
    }
    s=to_string(tmp%10)+s;
    tmp/=10;
  }
  if(s.size()>80)s="overflow";
  return s;
}

int main(){
  cin.tie(0);ios::sync_with_stdio(false);
  int n;
  string s1,s2;

  cin>>n;
  for(int i=0;i<n;i++){
    cin>>s1>>s2;
    if(s1.size()>80||s2.size()>80){
      cout<<"overflow"<<endl;
      continue;
    }
    
    cout<<calc(s1,s2)<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
  int n, maxlen;
  char a[101], b[101];

  cin >> n;
  for(int ii = 0 ; ii < n ; ii++){
    string ans = "";
    scanf("%s%s", a, b);
    
    maxlen = max(strlen(a), strlen(b));

    reverse(a, a+strlen(a));
    reverse(b, b+strlen(b));
    
    for(int i = strlen(a) ; i < 100 ; i++){
      a[i] = '0';
    }
    for(int i = strlen(b) ; i < 100 ; i++){
      b[i] = '0';
    }

    int tmp, tmp2 = 0;
    bool flag = 0;

    for(int i = 0 ; i < maxlen ; i++){
      tmp = (a[i] - '0') + (b[i] - '0') + tmp2;
      
      if(i == maxlen - 1){
	if(tmp >= 10){
	  tmp2 = 1;
	  tmp -= 10;
	  ans += tmp + '0';
	  ans += '1';
	}
	else ans += tmp + '0';
      }

      else if(tmp >= 10){
	tmp2 = 1;
	tmp -= 10;
	ans += tmp + '0';
      }
      else if(tmp <= 9){
	ans += tmp + '0';
	tmp2 = 0;
      }
    }

    reverse(ans.begin(), ans.end());

    int size = ans.size();

    if(size >= 80 || maxlen >= 80) cout << "overflow" << endl;
    else cout << ans << endl;
  }
  return 0;
}

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

int main(void)
{
int N,j,k=0;
cin >> N;
char strA[100000],strB[100000];
while(1){
k++;
if(k==N+1){
break;
}
cin >> strA >> strB;
int ans[81]={0};
ans[0]=11111;
if(strlen(strA)>80||strlen(strB)>80){
cout << "overflow" << endl;
continue;
}
int a[81]={0},b[81]={0};
if(strA[strlen(strA)-1]=='0'&&strB[strlen(strB)-1]=='0'){
    cout << 0 << endl;
    continue;
}
j=strlen(strA)-1;
for(int i=80 ; j>=0 ; i--){
a[i]=(int)strA[j]-48;
j--;
}
j=strlen(strB)-1;
for(int i=80 ; j>=0 ; i--){
b[i]=(int)strB[j]-48;
j--;
}
for(int i=80 ; i!=0 ; i--){
ans[i]=ans[i]+a[i]+b[i];
if(ans[i]>=10){
ans[i]=ans[i]-10;
ans[i-1]++;
}
}
if(ans[0]!=11111){
cout << "overflow" << endl;
continue;
}
for(int i=1 ; i<81 ; i++){
if(ans[i]!=0){
j=i;
break;
}
}
char c[3];
for(int i=j ; i<81 ; i++){
printf("%c",ans[i]+48);
}
cout << '\n';
}
return 0;
}

C++: int add(char *retstr, char *str1, char *str2){

	int str1len=strlen(str1);
	int str2len=strlen(str2);
	char ad,i1,i2;
	char offset1,offset2;
	char c1,c2;
	bool carry=false;

	if(str1len>str2len){
		offset1=0;
		offset2=str1len-str2len;
	}else{
		offset1=str2len-str1len;
		offset2=0;
	}

	for(int i=max(str1len,str2len);i<82;++i){
		retstr[i]=0;
	}

	for(int i=max(str1len,str2len)-1;i>=0;--i){

		if(i-offset1>=0){c1=str1[i-offset1];}else{c1=48;}
		if(i-offset2>=0){c2=str2[i-offset2];}else{c2=48;}
		i1=c1-48;i2=c2-48;//Ascii code to Number

		ad=i1+i2;
		if(carry)++ad;//桁上がり分

		if(ad>=10){ad %= 10; carry=true;}else{carry=false;}
		retstr[i+1]=ad+48;
	}

	if(carry){
		retstr[0]=1+48;
	}else{
		retstr[0]=0+48;
		for(int i=0;i<strlen(retstr)-1;++i){
			retstr[i]=retstr[i+1];
		}
		retstr[strlen(retstr)-1]=0;
	}

	if(strlen(retstr)>=81)return 1;

	return 0;

}

int main(){

	int n,overflowed;
	char str1[82], str2[82], retstr[82];

	cin>>n;

	for(int i=0;i<n;++i){

		cin>>str1;
		cin>>str2;

		if(strlen(str1)>=81||strlen(str2)>=81){
			cout<<"overflow"<<endl;
		}else{
			overflowed=add(retstr, str1, str2);
			if(overflowed){
				cout<<"overflow"<<endl;
			}else{
				cout<<retstr<<endl;
			}
		}
	}

	return 0;
}