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 <iomanip>
#include <string.h>
#include <stdio.h>
using namespace std;

void checkArray(char str[])
// 配列の内容確認(テスト用)
{
	int size = strlen(str);
	for(int i = 0; i < size; ++i)
	{
		cout << "str[" << i << "]: " << str[i] << endl;
	}
}
void str_reverse(char s[])
// 文字列を反転する
{
     int i, l = strlen(s);
     char t;
     for(i = 0; i < l/2; i++) {
         t = s[i]; s[i] = s[l-i-1]; s[l-i-1] = t;
     }
}
void add(char num1[], char num2[])
// 足し算した結果を文字列として返す
{
	char res[82];;
	bool carry = false; //繰り上がりの有無
	int maxlen = (strlen(num1) > strlen(num2)) ? strlen(num1) : strlen(num2);
	int flag1 = 0, flag2 = 0;

	str_reverse(num1);
	str_reverse(num2);

	for(int i = 0; i < maxlen+1; ++i){
		// '\n'以降は値を0とする
		if(num1[i] == '\0') flag1 = 1;
		if(num2[i] == '\0') flag2 = 1;
		res[i] = carry;
		if(!flag1)	res[i] += num1[i]-48;
		if(!flag2)	res[i] += num2[i]-48;
		carry = res[i] / 10;
		res[i] = res[i] % 10 + 48;
	}
	// 終端文字をつける
	if(res[maxlen] == '0')
		res[maxlen] = '\0';
	else res[maxlen+1] = '\0';

	// 元に戻す
	str_reverse(num1);
	str_reverse(num2);
	str_reverse(res);
	if(strlen(res) > 80)
		cout << "overflow" << endl;
	else
		cout << res << endl;
}

int main() {
	int dataset;
	char num1[81];
	char num2[81];

	cin >> dataset; // データセットの個数

	for(int i = 0; i < dataset; ++i){
			// 80桁以下の数字を入力
			cin  >> num1;
			cin  >> num2;
			if(strlen(num1) > 80 || strlen(num2) > 80){
				cout << "overflow" << endl;
			}else
			// 足し算した結果を表示
			add(num1, num2);
	}
	return 0;
}

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

int main(){
	string a,b;
	vector<int> sum;
	int al, bl, sl;
	int n, up, num;
	cin >> n;
	for(int i=0;i<n;++i){
		cin >> a >> b;
		al = a.size()-1;
		bl = b.size()-1;
		up = 0;
		while(al >= 0 || bl >= 0){
			num = up;
			if(al>=0) num += a[al] - 48;
			if(bl>=0) num += b[bl] - 48;
			if(num > 9){
				sum.push_back(num - 10);
				up = 1;
			}else{
				sum.push_back(num);
				up = 0;
			}
			al -= 1;
			bl -= 1;
		}
		if(up == 1){
			sum.push_back(1);
		}
		sl = sum.size();
		if(sl > 80){
			cout << "overflow" << endl;
		}else{
			for(int j=sl-1;j>=0;--j){
				cout << sum[j];
			}
			cout << endl;
		}
		sum.clear();
	}
	return 0;
}

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

int main(){

	int n;

	string a, b;
	char N1[80], N2[80];
	char sum[80];

	cin >> n;

	for( int i=0;i<n;i++ ){

		cin >> a;
		cin >> b;

		if( a.length() >= 80 || b.length() >= 80 )
			cout << "overflow" << endl;

		for( int i=0;i<80;i++ ){
			N1[i] = -1; N2[i] = -1; sum[i] = 0;
		}

		for( int i=1;i<=a.length();i++ )
			N1[i] = a[a.length()-i] - '0';
		for( int i=1;i<=b.length();i++)
			N2[i] = b[b.length()-i] - '0';

		int over = 0;
		
		for( int i=0;i<80;i++ ){


			if( N1[i] == -1 && N2[i] == -1 ){
				if( over >= 10 ){
					sum[i] = over / 10;
					over = 0;
				}else
					sum[i] = -1;
				continue;
			}

			if( N1[i] != -1 )
				sum[i] += N1[i];
			if( N2[i] != -1 )
				sum[i] += N2[i];

			sum[i] += over / 10;

			over = floor((double)sum[i]/10)*10;

			sum[i] -= over;
			
		}

		if(over > 0)cout << "overflow" << endl;
		else{		
			for( int i=1;i<=80;i++ ){
				if( sum[80-i] >= 0 )
					cout << (int)sum[80-i];
			}
			cout << endl;
		}


	}
	return 0;
}

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

using namespace std;

int main(int argc, char *argv[]) {
  int n;
  vector<string> result;
  string a, b;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    if (a.size() > 80 || b.size() > 80) {
      result.push_back("overflow");
      continue;
    }

    int carry = 0;
    if (a.size() < b.size())
      a.swap(b);
    string::reverse_iterator ria = a.rbegin();
    string::reverse_iterator rib = b.rbegin();

    while (true) {
      if (*ria - '0' + *rib - '0' + carry >= 10) {
        *ria += *rib + carry - '0' - 10;
        carry = 1;
      } else {
        *ria += *rib + carry - '0';
        carry = 0;
      }
      ria++;
      rib++;
      if (rib == b.rend())
        break;
    }
    /*                                                                                                                                                                                                                                                         
    cout << a << endl;                                                                                                                                                                                                                                         
    cout << carry << endl;                                                                                                                                                                                                                                     
    */
    while (true) {
      if (carry && ria == a.rend())
        a.insert(0, "1");
      else if (carry)
        if (*ria - '0' + 1 >= 10) {
          *ria += carry - 10;
          carry = 1;
        } else {
          *ria += 1;
          carry = 0;
          break;
        }
      else
        break;
      ria++;
    }
    if (a.size() > 80)
      result.push_back("overflow");
    else
      result.push_back(a);
  }

  for (int i = 0; i < result.size(); i++)
    cout << result[i] << endl;
  return 0;
}

C++: #include <cstdio>
#include <cstring>
char A[81],B[81],C[83];
int main() {
	int N,Alen,Blen;
	scanf("%d",&N);
	for(int i=0;i<N;i++) {
		scanf("%s",A);
		scanf("%s",B);
		Alen=strlen(A);
		Blen=strlen(B);
		memset(C,-1,sizeof(C));
		for(int j=Alen-1,k=0;j>=0;j--,k++) {
			C[k]=A[j]-'0';
		}
		for(int j=Blen-1,k=0;j>=0;j--,k++) {
			C[k]+=B[j]-'0';
		}
		for(int j=0;C[j]!=-1;j++) {
			if(C[j]/10) {
				if(C[j+1]!=-1)C[j+1]+=C[j]/10;
				else C[j+1]=C[j]/10;
			}
			C[j]%=10;
		}
		for(int j=82;j>=0;j--) {
			if(C[j]!=-1)putchar('0'+C[j]);
		}
		putchar('\n');
	}
}