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 <stdio.h>

#define DEGITS 80

void load(int a[]);
void print(int a[]);

int main(void){
    int a[DEGITS]; // a[0] = LSD
    int b[DEGITS];
    int n;
    int cry;
    
    scanf("%d", &n);
    for (int i=0; i<n; i++){
        // reset
        for (int i=0; i<DEGITS; i++){
            a[i]=b[i]=0;
        }
        // load
        load(a);
        load(b);
        // add ( a <- a + b )
        cry=0;
        for (int d=0; d<DEGITS; d++){
            a[d] += (b[d] + cry);
            cry = a[d]/10;
            if (a[d]>9){
                a[d]-=10;
            }
        }
        // print
        if (cry){
            printf("overflow\n");
        } else{
            print(a);
        }
    }

    return 0;
}

void load(int a[]){
    char *pt;
    char st[DEGITS+5];
    
    scanf("%s", st);
    for (pt=st; *pt!='\0'; pt++) ;
    for (int i=0; pt!=st; i++){
        a[i] = *(--pt)-'0';
    }
}

void print(int a[]){
    int d;
    
    for (d=DEGITS-1; d>0; d--){ 
        if (a[d] != 0) break;
    }
    for (; d>0; d--) printf("%d", a[d]);
    printf("%d\n", a[0]);
}

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

int main() {
	int n;
	cin >> n;
	for(int i = 0; i < n; i++) {
		string a, b;
		cin >> a >> b;
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());
		while(a.size() < 110) a += "0";
		while(b.size() < 110) b += "0";
		int carry = 0;
		string res = "";
		for(int i = 0; i< a.size(); i++) {
			res   += ((a[i] - '0') + (b[i] - '0') + carry) % 10 + '0';
			carry  = ((a[i] - '0') + (b[i] - '0') + carry) / 10;
		}
		while(res.size() > 1 && *(res.end()-1) == '0') res.erase(res.end()-1);
		reverse(res.begin(), res.end());
		if(res.size() > 80)
			cout << "overflow" << endl;
		else
			cout << res << endl;
	}
}

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 = 80;
		int i;
		string a, b;
		//0ú»@æ­í©çÈ¢ÌÅKÉå«­
		char c[N+10] = "";

		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++: #include <stdio.h>
#include <string.h>

int main(void)
{
  int N;
  scanf("%d", &N);

  int i,j,k;
  for(i=0; i<N; ++i){

    int digits[2][80];
    for(j=0; j<2; ++j){
      for(k=0; k<80; ++k){
        digits[j][k] = 0;
      }
    }

    int overflow = 0; 

    for(j=0; j<2; ++j){
      char digit[256];
      scanf("%s%*[^\n]", digit);
      getchar();
      
      if(overflow || strlen(digit)>80){
        overflow = 1;
      }else{
        for(k=0; k<strlen(digit); ++k){
          digits[j][k] = digit[strlen(digit)-1-k]-'0';
        }
      }
    }

    if(!overflow){
      int sum[81];
      for(j=0; j<81; ++j){
        sum[j] = 0;
      }

      for(j=0; j<80; ++j){
        for(k=0; k<2; ++k){
          sum[j] += digits[k][j];
        }
        sum[j+1] += sum[j]/10;
        sum[j] %= 10;
      }

      if(sum[80]>0){
        overflow = 1;
      }else{
        int available = 0;
        for(j=80; j>=0; --j){
          if(available || sum[j]!=0 || j==0){
            available = 1;
            printf("%d", sum[j]);
          }
        }
        printf("\n");
      }
    }

    if(overflow){
      printf("overflow\n");
    }
  }

  return 0;
}

C++: #define scanf_s scanf
#define sscanf_s sscanf
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 81
#define _MAX 100
//#define CONSTNUM 10000000
int main(void)
{
	int n, s = 0, x, y, r = 0, a, b;
	int sum_n[50][3] = { 0 };
	char sum[50][_MAX], astr[_MAX], bstr[_MAX], num[11] = { "0123456789" };
	char ca, cb;
	scanf_s("%d", &n);
	for (int i = 0; i < n; ++i) {
		scanf_s("%s %s", &astr,_MAX, &bstr, _MAX);
		for (x = 0; astr[x] != '\0'; ++x);
		for (y = 0; bstr[y] != '\0'; ++y);
		if (x > 80 || y > 80) {
			printf("overflow\n");
			continue;
		}
		for (int j = 0; j < x || j < y; ++j) {
			if (j < x && j < y) {
				ca = astr[x - j - 1]; cb = bstr[y - j - 1];
				sscanf_s(&ca, "%d", &a);
				sscanf_s(&cb, "%d", &b);
				if (x > y) sum[i][x - j] = num[(a + b + r) % 10];
				else sum[i][y - j] = num[(a + b + r) % 10];
				if (a + b + r >= 10) r = (a + b + r) / 10;
				else r = 0;
			}
			else {
				if (x > y) {
					if (r != 0) {
						ca = astr[x - j - 1];
						sscanf_s(&ca, "%d", &a);
						sum[i][x - j] = num[(a + r) % 10];
						if (a + r >= 10) r = (a + r) / 10;
						else r = 0;
					}
					else {
						sum[i][x - j] = astr[x - j - 1];
					}
				}
				else {
					if (r != 0) {
						cb = bstr[y - j - 1];
						sscanf_s(&cb, "%d", &b);
						sum[i][y - j] = num[(b + r) % 10];
						if (b + r >= 10) r = (b + r) / 10;
						else r = 0;
					}
					else {
						sum[i][y - j] = astr[y - j - 1];
					}
				}
			}
		}
		sum_n[i][0] = x; sum_n[i][1] = y; sum_n[i][2] = r;
		r = 0;
	}
	for (int i = 0; i < n; ++i) {
		x = sum_n[i][0]; y = sum_n[i][1]; r = sum_n[i][2];
		if (y <= 80 - r && x <= 80 - r) {
			if (r == 1) printf("%d", r);
			for (int j = 1; j <= x || j <= y; ++j) {
				printf("%c", sum[i][j]);
			}
		}
		else {
			printf("overflow");
		}
		printf("\n");
	}
}

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

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