Go: package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Scan()
	dataset, _ := strconv.Atoi(sc.Text())
	var firstdata *big.Int

	for i := 0; i < dataset*2; i++ {
		n := new(big.Int)
		sc.Scan()
		data, _ := n.SetString(sc.Text(), 10)

		if i%2 == 0 {
			firstdata = data
			continue
		}

		result := new(big.Int)
		if result := result.Add(data, firstdata); len(result.String()) > 80 {
			fmt.Println("overflow")
			continue
		} else {
			fmt.Println(result)
		}
	}
}

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);
		if (str_a == "0" && str_b == "0"){std::cout << 0 << std::endl;
		}
		else{

			OverDigit OverDigit_a(str_a, str_b);//???????????§??????
			OverDigit_a.Add();
		}
	}
	return 0;
}

C++: //0015 National Budget
//80ÜÅÌ2ÂÌ®Ì«µZÊðoÍ¹æ
//1sÚÉf[^Zbgnª^¦çêé
//^¦çê½â»Ìaª80ð´¦½êAoverflowÆoÍµÄ­¾³¢

#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;


int main(void)
{
	int n;
	cin >> n;
	while(n--)
	{
		const int N = 3;
		int i;
		string a, b;
		//0ú»
		char c[N+2] = "";

		cin >> a >> b;

		//vZµâ·¢æ¤É½]
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());

		int aSize, bSize;
		aSize = a.size();
		bSize = b.size();

		//Ü¸ÍAcÉ»ÌÜÜlðüêÄ¢­
		for(int i = 0; i < min( max(aSize, bSize), N+1); i++)
		{
			int s = 0;
			if(i < aSize)
				s += a[i] - '0';
			if(i < bSize)
				s += b[i] - '0';

			c[i] += s;
			c[i+1] += c[i]/10;
			c[i] %= 10;
		}

		//ã©ç©Ä¢ÁÄA0ÈOÌ¶ª»ê½ç¶»·é
		bool isAnswer = false;
		for(i = sizeof(c)-1; i >= 0; i--)
		{
			if(c[i])
				isAnswer = true;
			if(isAnswer)
				c[i] += '0';
		}
		//½]µÄ®¬
		reverse(c, c+strlen(c));

		//àµà80¶ÚªNULL¶Å êÎI[o[t[
		if(c[N])
			cout << "overflow" << endl;
		//dlãA¦ª0ÈçNULL¶ÅÜéÌÅËÁÞ
		else if(c[0] == '\0')
			cout << '0' << endl;
		else
			cout << c << endl;
	}
	return 0;
}

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

char n1[100], n2[100], ans[100];

//n1とn2の和をansに入れる
void sum(int n, int m, int p1, int p2){//n:桁目, m:繰り上がり, p1:n1の注目桁, p2:n2の注目点
  int tmp;
  if(p1==-1 && p2==-1){
    if(m==1) printf("1");
    return;
  }
  if(p1==-1){
    tmp=n2[p2]+m-'0';
    ans[n]=tmp%10+'0';
    sum(n-1, (tmp>9 ? 1 : 0), -1, p2-1);
    return;
  }
  if(p2==-1){
    tmp=n1[p1]+m-'0';
    ans[n]=tmp%10+'0';
    sum(n-1, (tmp>9 ? 1 : 0), p1-1, -1);
    return;
  }
  tmp=n1[p1]+n2[p2]+m-2*'0';
  ans[n]=tmp%10+'0';
  sum(n-1, (tmp>9 ? 1 : 0), p1-1, p2-1);
  return;
}

int main(){
  int n;
  scanf("%d", &n);
  for(int i=0; i<n; i++){
    fill(ans, ans+99, '\0');
    scanf("%s", n1), scanf("%s", n2);
    sum((strlen(n1)>strlen(n2) ? strlen(n1)-1 : strlen(n2)-1), 0, strlen(n1)-1, strlen(n2)-1);
    printf("%s\n", ans);
  }
  return 0;
}

C++: #include<stdio.h>
#include<math.h>
#include<algorithm>
#include<string.h>
using namespace std;
char s[100],t[100];
int a[100],b[100],c[110];
int main()
{
    int T,d=0;
    int n=1;
    scanf("%d%*c",&T);
    while(T--)
    {
        memset(s,0x00,sizeof(s));
        memset(t,0x00,sizeof(t));
        memset(a,0,sizeof(a));
        memset(b,0,sizeof(b));
        memset(c,-1,sizeof(c));
        scanf("%s",s);
        scanf("%s",t);
        if(strlen(s)>80||strlen(t)>80)
           {
               printf("overflow\n");
        break;
           } 
        int l=0;
        for(int i=strlen(s)-1; i>=0; i--)
            a[l++]=s[i]-'0';
        int k=0;
        for(int i=strlen(t)-1; i>=0; i--)
            b[k++]=t[i]-'0';
        if(l<k)
            l=k;
        int v=0;
        for(int i=0; i<=l; i++)
        {
            if(a[i]+b[i]+v>=10)
            {
                c[i]=a[i]+b[i]+v-10;
                v=1;
            }
            else
            {
                c[i]=a[i]+b[i]+v;
                v=0;
            }
        }
        if(c[l]!=0&&l>80)
        {
            printf("overflow\n");
            break;
        }
        else if(c[l]==0&&l-1>80)
        {
            printf("overflow\n");
            break;
        }
        if(c[l]!=0)
            printf("%d",c[l]);
        for(int i=l-1;i>=0;i--)
            printf("%d",c[i]);
        printf("\n");
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <utility>
using namespace std;
int toNumber(char c){
	switch (c)
	{
	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;
	}
	return 0;
}
int main()
{
	int n, sa, sb, k, r, i;
	string a, b;
	int sum[100] = {};
	cin >> n;
	while (n--){
		cin >> a >> b;
		if (a.size() < b.size()) swap(a, b);
		sa = a.size();
		sb = b.size();
		if (sa > 80){
			cout << "overflow\n";
			continue;
		}
		k = i = 0;
		for (; i < sa; ++i){
			if (i < sb) k = toNumber(a[sa - 1 - i]) + toNumber(b[sb - 1 - i]) + k;
			else 		k = toNumber(a[sa - 1 - i]) + k;
			r = k % 10;
			k = k / 10;
			sum[i] = r;
		}
		if (0 != k) sum[i] = k;
		else --i;
		if (i >= 80){
			cout << "overflow\n";
			continue;
		}
		for (int d = i; d >= 0; --d)
			cout << sum[d];
		cout << "\n";
	}
	return 0;
}