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 <algorithm>
using namespace std;
int main(){
  string num1,num2,tmp;
  int n;
  cin >> n;
  cin.clear();
  while(n--){
  cin >> num1 >> num2;
  if(num1.size() < num2.size()){
    tmp = num2;
    num2 = num1;
    num1 = tmp;
  }

  for(int i = 0 ; i < num1.size() ; i++ )tmp[i] = num1[i];
  for(int i = num1.size() - 1 ; i >= 0 ; i-- )
    {
      num1[i] = tmp[num1.size() - 1 - i];
    }
  for(int i = 0 ; i < num2.size() ; i++ )tmp[i] = num2[i];

  for(int i = num2.size() - 1  ; i >= 0 ; i-- )
    {
      num2[i] = tmp[num2.size() - 1 - i];
    }
  for(int i = num2.size() ; i < num1.size() ; i++ )num2+='0';
  char tmp2 = '0';
  string ans;
  for(int i = 0 ; i < num1.size() ; i++ ){
    if((tmp2 - '0') + (num1[i] - '0') + (num2[i] - '0') > 9){
      ans += (((tmp2 - '0') + (num1[i] - '0') + (num2[i] - '0') - 10) + '0');
      tmp2 = '1';
    } else {
      ans += (((tmp2 - '0') + (num1[i] - '0') + (num2[i] - '0')) + '0');
      tmp2 = '0'; 
    }
  }
  
  if((tmp2 - '0') + (num1[num1.size() - 1] - '0') + (num2[num1.size() - 1] - '0') > 9)ans+='1'; 

  for(int i = ans.size() ; i >= 0 ; i-- ){
    cout << ans[i];
  }  
  cout << endl;
}
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>

using namespace std;

string sum(string& a, string& b){
	int i = a.length() - 1;
	int j = b.length() - 1;
	int carry = 0;
	string temp;

	while(i >= 0 || j >= 0){
		int c = i >= 0 ? a[i] - '0' : 0;
		int d = j >= 0 ? b[j] - '0' : 0;

		temp.push_back((c + d + carry) % 10 + '0');
		carry = (c+d+carry) / 10;

		--i, --j;
	}

	if(carry)
		temp.push_back('1');

	reverse(begin(temp), end(temp));

	return temp;
}

int main(){
	int n;
	cin >> n;

	vector<string> input(n*2);

	for(int i = 0; i < n*2; i++){
		cin >> input[i];
	}

	for(int i = 0; i < n; i++){
		string t = sum(input[2*i], input[2*i+1]);
		if(t.length() <= 80)
			cout << t << endl;
		else
			cout << "overflow" << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <cstring>

using namespace std;

void initiate(int* a)
{
	for (int j=0; j<101; j++) a[j] = 0;
}

int main()
{
	int a[101], b[101];
	char buf[101];
	
	int datasets;
	cin >> datasets;
	
	int len;
	
	for (int i=0; i<datasets; i++) {
		initiate(a); initiate(b);
		cin >> buf;
		len = strlen(buf);
		for (int j=0; j<len; j++) a[j] = static_cast<int>(buf[len-j-1] - 48);
		cin >> buf;
		len = strlen(buf);
		for (int j=0; j<len; j++) b[j] = static_cast<int>(buf[len-j-1] - 48);
		
		//test
		//for (int j=0; j<100; j++) cout << a[j];
		//cout << endl;
		//for (int j=0; j<100; j++) cout << b[j];
		//cout << endl;
		
		int carry = 0;
		for (int j=0; j<101; j++) {
			a[j] += b[j] + carry;
			carry = a[j] / 10;
			a[j] -= carry * 10;
		}
		
		bool nonzeroFlg = false;
		for (int j=100; j>=0; j--) {
			if (j>=80 && a[j]>0) {
				cout << "overflow";
				break;
			}
			if (a[j]>0) nonzeroFlg = true;
			if (nonzeroFlg) cout << a[j];
		}
		
		if (!nonzeroFlg) cout << 0;
		
		cout << endl;
	}
	
	return 0;
}

C++: #include <stdio.h>
#include <string.h>
#define N 80

int main(void){
    char buf[N+1];
    int datas;
    int degits;
    int lint1[N], lint2[N], sum[N];
    int cry;
    
    scanf("%d", &datas);
    for (int n=0; n<datas; n++){
        // reset
        for (int i=0; i<N; i++) lint1[i]=lint2[i]=0;
        // input
        scanf("%s", buf);
        degits = strlen(buf);
        for (int i=0; i<degits; i++){
            lint1[degits-i-1]= buf[i]-'0';
        }
        scanf("%s", buf);
        degits = strlen(buf);
        for (int i=0; i<degits; i++){
            lint2[degits-i-1]= buf[i]-'0';
        }
        // calc
        cry=0;
        for (int i=0; i<N; i++){
            sum[i] = lint1[i]+lint2[i] + cry;
            cry = sum[i]>9 ? 1:0;
            if (cry) sum[i] -= 10;
        }
        // output
        if (cry){
            puts("overflow");
        } else {
            bool zero=true;
            if (cry) puts("1");
            for (int i=N-1; i>=0; i--){
                if (zero && sum[i] != 0) zero=false;
                if (!zero) printf("%d", sum[i], i);
            }
            printf("\n");
        }
    }
    
    return 0;
}

C++: #include <cstdio>
#include <cstring>
#define MAX_NUM 100

using namespace std;

void array_add(int *a,int *b){
	int i;
	for(i = MAX_NUM - 1;i > 0;i--){
		a[i] = a[i] + b[i];
		a[i - 1] = a[i - 1] + a[i] / 10;
		a[i] %= 10;
	}
}

int main(void){
	int n, i, j, len1,len2, val1[MAX_NUM], val2[MAX_NUM];
	char c;
	scanf("%d%*c",&n);
	for(i = 0;i < n;i++){
		for(j = 0;(c = getchar()) != '\n';j++){
			val1[j] = c - '0';
		}
		len1 = j;
		for(j = 0;(c = getchar()) != '\n';j++){
			val2[j] = c - '0';
		}
		len2 = j;
		for(j = MAX_NUM - 1;j > MAX_NUM - 1 - len1;j--){
			val1[j] = val1[len1 - 1 + (j - (MAX_NUM - 1))];
		}
		for(;j >= 0;j--){
			val1[j] = 0;
		}
		val1[MAX_NUM] = 0;
		for(j = MAX_NUM - 1;j > MAX_NUM - 1 - len2;j--){
			val2[j] = val2[len2 - 1 + (j - (MAX_NUM - 1))];
		}
		for(;j >= 0;j--){
			val2[j] = 0;
		}
		array_add(val1,val2);
		for(j = 0;val1[j] == 0 && j < MAX_NUM;j++);
		if(j <= MAX_NUM - 81)
			printf("overflow");
		else if(j == MAX_NUM)
			printf("0");
		else{
		for(;j < MAX_NUM;j++){
			printf("%d",val1[j]);
		}
		}
		printf("\n");
	}
	return 0;
}