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 <algorithm>
     
    class BigInteger {
    	std::string num_str_;
    public:
    	BigInteger(std::string&& str) {
    		num_str_ = std::move(str);
    	}
    	BigInteger operator+(const BigInteger& rhs) {
    		return plus(rhs);
    	}
    	
    	std::string to_string() const {return num_str_;}
    	
    private:
    	BigInteger plus(const BigInteger& rhs) {
    		std::string a = num_str_;
			std::string b = rhs.to_string();
			std::reverse(a.begin(), a.end());
			std::reverse(b.begin(), b.end());
			const int max = std::max(a.length(), b.length());
			const int min = std::min(a.length(), b.length());

			if (a.length() < b.length()) {
				std::swap(a, b);
			}
			for (int i = min; i < max; ++i) {
				b.push_back('0');
			}

			std::string result("");
			int carry = 0;
			for (int i = 0; i < max; ++i) {
				int sum = to_int(a.at(i)) + to_int(b.at(i)) + carry;
				carry = sum / 10;
				const char c_num = to_char(sum % 10);
				result.push_back(c_num);
			}
			if (carry > 0) {
				result.push_back(to_char(carry));
			}
			
			std::reverse(result.begin(), result.end());
			return BigInteger(std::move(result));
    	}
    	
    	int to_int(const char& c) const {
    		return c - '0';
    	}
    	char to_char(const int& i) const {
    		return i + '0';
    	} 
    };
     
    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 >> str2;
    		BigInteger bi1(std::move(str1));
    		BigInteger bi2(std::move(str2));
    		ans_list.push_back(bi1 + bi2);
    	}
    	
    	for (auto ans : ans_list) {
    		auto ans_str = ans.to_string();
    		std::cout << (ans_str.length() > 80 ? "overflow" : ans_str) << std::endl;
    	}
    }

C++: #include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
	int d;
	for(cin>>d;d>0;d--){
		char ans[200];
		char n1[200];
		char n2[200];
		for(int i=0;i<=100;i++)ans[i]='0';
		scanf("%s",n1);
		scanf("%s",n2);
		int h1=strlen(n1)-1;
		int h2=strlen(n2)-1;
		int limit=max(h1,h2);
		int i;
		bool flg=false;
		for( i=0;i<=limit;i++,h1--,h2--){
			flg=false;
			int n1_tmp=0;
			int n2_tmp=0;
			if(h1>=0){
				n1_tmp=n1[h1]-'0';
			}
			if(h2>=0){
				n2_tmp=n2[h2]-'0';
			}
			int sum=n1_tmp+n2_tmp;
			if(sum>=10){
				if(i==79){
					i++;
					flg=true;
					break;
				}
				ans[i+1]=ans[i+1]+1;
				sum=sum%10;
				flg=true;
			}

			if(ans[i]+sum>'9'){
				if(i==79){
					i++;
					flg=true;
					break;
				}
				ans[i]=ans[i]+(sum-10);
				ans[i+1]+=1;
				flg=true;
			}
			else ans[i]+=sum;
		}
		if(flg){
			i++;
		}
		ans[i]='\0';
		if(i>80)cout<<"overflow"<<endl;
		else{
			for(i--;i>=0;i--){
				cout<<ans[i];
			}
			cout<<endl;
		}
//		cout<<"size:"<<strlen(ans)<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int n;
  cin>>n;
  while(n--){
    long long int a,b;
    cin>>a>>b;
    cout<<a+b<<endl;
  }
}

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

int changeNumber(char number)
{
	int num = 0;
	for (char i = 48; i < 58; i++) {
		if (number == i) return num;
		num++;
	}
}

void puls(string number1, string number2)
{
	stack<int> s;
	int tmp = 0;
	for (int i = 1; i <= number1.size() && i <= number2.size(); i++) {
		tmp =  tmp + changeNumber(number1[number1.size() - i]) + changeNumber(number2[number2.size() - i]);
		s.push(tmp % 10);
		tmp /= 10;
	}
	for (int i = number2.size() + 1; i <= number1.size(); i++) {
		tmp = tmp + changeNumber(number1[number1.size() - i]);
		s.push(tmp % 10);
		tmp /= 10;
	}
	if (tmp > 0) s.push(tmp);
	if (s.size() > 80) cout << "overflow" << endl;
	else {
		while(0 < s.size()) {
			cout << s.top();
			s.pop();
		}
		cout  << endl;
	}
}

int main(void)
{
	string number1, number2;
	int count;

	cin >> count;
	for (int i = 0; i < count; i++) {
		cin >> number1 >> number2;
		if (number1.size() < number2.size()) puls(number2, number1);
		else puls(number1, number2);
	}
	
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;

class LargeInteger
{
private:
	vector<int> places;
public:
	LargeInteger( string number )
	{
		reverse( number.begin(), number.end() );

		for ( unsigned int i = 0; i < number.length(); i++ )
		{
			if( i < places.size() )
			{
				this -> places[i] = number[i] - '0';
			}
			else
			{
				this -> places.push_back( number[i] - '0' );
			}
		}

		return;
	}

	LargeInteger& operator += ( string number )
	{
		reverse( number.begin(), number.end() );

		for ( unsigned int i = 0; i < number.length(); i++ )
		{
			if ( i < places.size() )
			{
				this -> places[i] += number[i] - '0';
			}
			else
			{
				this -> places.push_back( number[i] - '0' );
			}
		}

		return *this;
	}

	void printNumber()
	{
		adjust();

		if ( places.size() < 80 )
		{
			for ( vector<int>::reverse_iterator it = places.rbegin(); it != places.rend(); it++ )
			{
				cout << *it;
			}
		}
		else
		{
			cout << "overflow";
		}
		cout << endl;
		
		return;
	}
	
	void adjust()
	{
		for ( unsigned int i = 0; i < places.size(); i++ )
		{
			if ( 10 <= places[i] )
			{
				if ( i + 1 < places.size() )
				{
					places[i+1] += places[i] / 10;
				}
				else
				{
					places.push_back( places[i] / 10 );
				}
				places[i] %= 10;
			}
		}

		return;
	}
};


int main()
{
	int n;
	string buffer;

	cin >> n;

	for ( int i = 0; i < n; i++ )
	{
		cin >> buffer;
		LargeInteger li( buffer );

		cin >> buffer;
		li += ( buffer );

		li.printNumber();
	}

	return 0;
}

C++: #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main(){
	string a,b;
	vector<int> ans;
	int n,tmp,carry,num;
	bool flag = true;
	cin >> n;
	for(int i=0; i<n; i++){
		ans.clear();
		cin >> a >> b;
		int ai = a.size()-1;
		int bi = b.size()-1;
		carry=0;
		while(ai >= 0 || bi >= 0){
			tmp=0;
			if(ai >= 0) tmp += a[ai] - '0';
			if(bi >= 0) tmp += b[bi] - '0';
			ans.push_back((tmp+carry)%10);
			carry = (tmp+carry)/10;
			ai--; bi--;
		}
		if(carry != 0) ans.push_back(carry);
		if(ans.size() > 80 && flag == true){
			cout << "overflow" << endl;
			flag = false;
		}
		if(flag == true){
			for(int j=ans.size()-1; j>=0; j--)
				cout << ans[j];
			cout << endl;
		}
	}
	return 0;
}