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_Max, str_rest;

	str_Max = str.length() / CAPACITY;//
	str_rest = str.length() % CAPACITY;

		for (int j = str.length() - CAPACITY; str_Max > 0; j = j-CAPACITY){
		num_str[k] = stoi::stoi(str.substr(j, CAPACITY));
		loc = k;
		k--;
		str_Max--;
	}
	//?????????????????????????????????????????\??????
	
		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);
		OverDigit OverDigit_a(str_a,str_b);//???????????§??????
		OverDigit_a.Add();
	}

	return 0;
}

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

int main(){
	int n;
	cin >> n;
	while( n-- ){
		string num1, num2;
		cin >> num1 >> num2;
		char sum[101];
		int degit = 0;
		/*for( int i = 0; i < min(num1.size(), num2.size()); i++ ){
			int now = degit+(int)(num1[num1.size()-i-1]-'0')+(int)(num2[num2.size()-i-1]-'0');
			sum[i] = (char)(now%10);
			if( now >= 10 ) degit = 1;
			else degit = 0;
		}*/
		for( int i = 0; i < sizeof(sum); i++ ) sum[i] = '0';
		for( int i = 0; i < num1.size(); i++ ){
			sum[100-i] += (int)(num1[num1.size()-i-1]-'0');
		}
		for( int i = 0; i < num2.size() || degit != 0; i++ ){
			int now;
			if( i < num2.size() ){
				now = (int)(sum[100-i]-'0') + (int)(num2[num2.size()-i-1]-'0') + degit;
			}else{
				now = (int)(sum[100-i]-'0') + degit;
			}
			//sum[100-i] = sum[100-i] + num2[num2.size()-i-1]-'0';
			sum[100-i] = (char)(now%10+'0');
			if( now >= 10 ) degit = 1;
			else degit = 0;
			//cout << "now" << now << endl;
		}
		for( int i = 0; i < 101; i++ ) cout << sum[i];
		cout << endl;
	}
}

C++: #include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
#include <map>
#include <fstream>
#include <array>
#include <utility>
#include <functional>
#include <stack>

using namespace std;
typedef long long Int;
#define REP(i , x) for(int i = 0 ; i < x ; ++i)

typedef pair<int, int> P;


int main()
{
	int n;
	string a, b;
	cin >> n;
	REP(i, n){
		int a_a[100] = { 0 };
		int b_a[100] = { 0 };
		int c_a[100] = { 0 };
			cin >> a >> b;
			if (a.length() >= 80 || b.length() >= 80){
				cout << "overflow" << endl;
			}

			REP(i, a.length()){
				a_a[i] = a[a.length() - i -1] - '0';
			}
			
			REP(i, b.length()){
				b_a[i] = b[b.length() - i -1] - '0';
			}

			REP(i, 84){
				int temp = a_a[i] + b_a[i] + c_a[i];
				c_a[i + 1] += temp / 10;
				c_a[i] = temp % 10;
			}

			int i = 84;

			while (!c_a[i] && i){
				--i;
			}
			if (i >= 80){
				cout << "overflow" << endl;
			}

			while (i >= 0){
				cout << c_a[i];
				--i;
			}
			cout << endl;
		}

	return 0;
}

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

#define DIGIT 100000

int main(void){
	char temp[1000];
	long long int a[100];
	long long int b[100];
	long long int c[100];
	long long int t;
	int n;

	scanf("%d", &n);
	for(int i=0; i<n; i++){
		for(int k=0; k<100; k++){
			a[k] = 0;
			b[k] = 0;
			c[k] = 0;
		}
		int j;
		scanf("%s", temp);

		for(int k=0, j=strlen(temp)-1; j>=0; k++){
			for(int l=0; l<5; l++, j--){
				if(j < 0) break;
				a[k] +=	(temp[j] - '0') * pow(10, l);
			}
		}

		for(int k=0; k<100; k++){
			temp[k] = 0;
		}

		scanf("%s", temp);
		for(int k=0, j=strlen(temp)-1; j>=0; k++){
			for(int l=0; l<5; l++, j--){
				if(j < 0) break;
				b[k] +=	(temp[j] - '0') * pow(10, l);
			}
		}

		for(j=0; j<100; j++){
			t = a[j] + b[j] + c[j];
			c[j] = t % DIGIT;
			c[j+1] += (t / DIGIT);
		}
		
		j=99;
		while(c[j] == 0) j--;
		if(j > 15){
			printf("overflow\n");
		}else{
			printf("%lld", c[j]);
			j--;
			for(; j>=0; j--){
				printf("%05lld", c[j]);
			}
			puts("");
		}
	}

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std ;

int f( char x ){
	switch (x){
		case '0' : return 0 ;
		case '1' : return 1 ;
		case '2' : return 2 ;
		case '3' : return 3 ;
		case '4' : return 4 ;
		case '5' : return 5 ;
		case '6' : return 6 ;
		case '7' : return 7 ;
		case '8' : return 8 ;
		case '9' : return 9 ;
	}
}

int main(){
	
	int n ;
	for( cin >> n ; n-- ; ){
		string a,b ;
		cin >> a >> b ;
		if( a.size() > b.size() ) swap(a,b) ;
		reverse( a.begin() , a.end() ) ;
		reverse( b.begin() , b.end() ) ;
		while( a.size() < b.size() ) a+='0' ;
		
		vector<int> c ;
		c.push_back(0) ;
		for( int i=0 ; i<a.size() ; i++ ){
			c[i] += f(a[i]) + f(b[i]) ;
			c.push_back( c[i]/10 ) ;
			c[i] %= 10 ;
		}
		if( c[c.size()-1] == 0 ) c.pop_back() ;
		reverse( c.begin() , c.end() ) ;
		
		if( c.size() >= 80 ) cout << "overflow" << endl ;
		else {
			for( int i=0 ; i<c.size() ; i++ ) cout << c[i] ;
			cout << endl ;
		}
	}
	
return 0 ;
}