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<string>
#include<algorithm>
using namespace std;

int main()
{
	string s1, s2, sum;
	int n;
	cin >> n;
	while (n--) {
		cin >> s1 >> s2;
		int len = max(s1.size(), s2.size());
		for (int i = 0; i < len; i++) {
			sum += "0";
		}
		//?????????????????????????????????????????????'0'??§??°????????????
		if (s1.size() < s2.size()) {
			//s1????????????????????§s2.size()-s1.size()?????????'0'?????°????????????
			//??????s1??????????????????
			string r_s1 = "";
			for (int i = s1.size() - 1; i >= 0; i--) {
				r_s1 += s1[i];
			}
			//r_s1???s2.size()-s1.size()?????????'0'???????????°??????
			for (int i = 0; i < s2.size() - s1.size(); i++) {
				r_s1 += "0";
			}
			//r_s1????????????????????????
			s1 = "";
			for (int i = r_s1.size() - 1; i >= 0; i--) {
				s1 += r_s1[i];
			}
		}
		else {
			//??????s2??????????????????
			string r_s2 = "";
			for (int i = s2.size() - 1; i >= 0; i--) {
				r_s2 += s2[i];
			}
			//s1.size()-s2.size()?????????'0'??§????????°??????
			for (int i = 0; i < s1.size() - s2.size(); i++) {
				r_s2 += "0";
			}
			//r_s2??????????????????
			s2 = "";
			for (int i = r_s2.size() - 1; i >= 0; i--) {
				s2 += r_s2[i];
			}
		}
		




		int carry = 0;
		char s;
		for (int i = 0; i < len; i++) {
			if (carry == 0) {
				s = s1[s1.size() - 1 - i] - '0' + s2[s2.size() - 1 - i] - '0' + '0';
				if (s - '0' >= 10) {
					carry = 1;
					sum[len - 1 - i] = int((s - '0') % 10) + '0';
				}
				else {
					sum[len - 1 - i] = s;
				}
			}
			else {//carry over
				s = s1[s1.size() - 1 - i] - '0' + s2[s2.size() - 1 - i] - '0' + '0' + 1;
				if (s - '0' >= 10) {
					carry = 1;
					sum[len - 1 - i] = int((s - '0') % 10) + '0';
				}
				else {
					carry = 0;
					sum[len - 1 - i] = s;
				}
			}
		}

		cout << (carry == 1 ? "1" : "");
		for (int i = 0; i < len; i++) {
			cout << (int)sum[i] - '0';
		}
		cout << endl;
	}
    return 0;
}

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

#define CAPACITY 9

 
namespace 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[])
{
td::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[0] = 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];
    }
}

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(){
    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<stdio.h>
#include<iostream>
#include<list>
#include<map>
#include<vector>
#include<algorithm>
#include<string.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << x << endl;
using namespace std;

int main(){
    int n,g;
    int k;
    bool check;

    cin >> n;
    rep(i,n){
        char c1[81], c2[81];
        int i1[81] = {0}, i2[81] = {0};
        int ans[82] = {0};
        check = false;
        k = 0;
        cin >> c1 >> c2;
        for(int j = strlen(c1) - 1; 0 <= j; j--, k++){
            i1[k] = c1[j] - '0';
        }
        k = 0;
        for(int j = strlen(c2) - 1; 0 <= j; j--, k++){
            i2[k] = c2[j] - '0';
        }
        rep(j, 81){
            ans[j]+= i1[j] + i2[j];
            if(ans[j] >= 10){
                ans[j]-=10;
                ans[j+1]++;
            }
        }
        for(int j = 81; 0 <= j; j--){
            if(ans[81] != 0){
                cout << "overflow";
                break;
            }
            if(ans[j] != 0)
                check = true;
            if(check == true)
                cout << ans[j];
        }cout << endl;

    }
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include<string>
#include <utility>
using namespace std;
using namespace std;
int main(){
	int m;
	string in,in2;
	int a[90],b[90],ans[90];
	int f;
	int a_len,b_len,m_len;
	cin>>m;
	while(m--){
		for(int i=0;i<90;i++){
			a[i]=b[i]=ans[i]=0;
		}
		cin>>in;
		cin>>in2;
		a_len=in.size();
		b_len=in2.size();
		for(int i=0;i<a_len;i++){
			a[a_len-1-i]=in[i]-'0';
		}
		for(int i=0;i<b_len;i++){
			b[b_len-1-i]=in2[i]-'0';
		}
		m_len=max(a_len,b_len);
		
	}
	
	
	return 0;
}