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<algorithm>
#include<iostream>
#include<string>

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)

using namespace std;

int n;
string a,b;

int main(void){
	cin>>n;
	while(n--){
		cin>>a>>b;
		int siz = max(a.size(),b.size());
		if(a.size()>80||b.size()>80){
			cout<<"overflow"<<endl;
			continue;
		}
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());		
		a.resize(80);
		b.resize(80);
		
		string ans="";
		int c = 0;
		rep(i,siz){
			if(i>=a.size()||a[i]=='\0')
				a[i] = '0';
			if(i>=b.size()||b[i]=='\0')
				b[i] = '0';
			int t = int(a[i]) - '0' + b[i] - '0' + c;
			c = 0;
			if(t>=10){
				c = 1 , t %= 10;
			}
			ans += char(t+'0');				
		}
		
		if(c)
			ans += '1';
			
		if(ans.size()>80)
			cout<<"overflow"<<endl;
		else {
			rep(i,ans.size()){
				cout<<ans[ans.size()-1-i];
			}
			cout<<endl;
		}
	}
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>

#define MAX_SIZE 90;

#define toI(x) (x-'0')

using namespace std;

class Z
{
private:
  int size;
  char d[MAX_SIZE];
public:
  Z(char *s)
  {
    size = strlen(s);
    for(int i=0;i<MAX_SIZE - size;i++)
      d[i] = 0;
    for(int i=0,j=MAX_SIZE - size;j < MAX_SIZE; i++, j++)
      d[j] = s[i];
  }

  void add(Z r)
  {
    int tmp = max(this->size, r.size);
    int updigit = 0;
    for(int i=MAX_SIZE-1;i>=0;i--){
      int a = 0, b = 0;
      if(this->d[i] == 0&& r.d[i] == 0){
	if(!updigit)
	  goto end;
	this->d[i] = updigit+'0';
	updigit = 0;
	tmp++;
      }else{
	if(this->d[i])
	  a = toI(this->d[i]);
	if(r.d[i])
	  b = toI(r.d[i]);
	int n = a + b + updigit;
	updigit = n / 10;
	this->d[i] = (n % 10)+'0';
      }
    }
  end:
    this->size = tmp;
    return;
  }

  void print()
  {
    if(this->size > 80){
      puts("overflow");
      return;
    }
    for(int i=0;i<MAX_SIZE;i++)
      if(d[i] != -1)
	putchar(d[i]);
    puts("");
  }

  int sz()
  {
    return this->size;
  }
};

int main()
{
  int x;
  scanf("%d", &x);
  char s1[MAX_SIZE], s2[MAX_SIZE];  
  for(int i=0;i<x;i++){
 /*   scanf("%s%s",s1, s2);
   Z z1(s1);
    Z z2(s2);
    if(z1.sz() > 80 || z2.sz() > 80){
      puts("overflow");
      continue;
    }
    z1.add(z2);
    z1.print(); */
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#include <stack>
#include <iomanip>
#include <numeric>
#include <queue>

using namespace std;
using ll = long long;
#define MOD 1000000007
#define INF 1LL << 59

int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    int n;
    cin >> n;

    while (n--)
    {
        string s, t;
        cin >> s >> t;
        //cout << s << " " << t << endl;
        int carry = 0;
        string ans = "";
        while (!s.empty() || !t.empty())
        {
            int lastDigit_1 = (s.empty()) ? 0 : s.back() - '0';
            int lastDigit_2 = (t.empty()) ? 0 : t.back() - '0';

            int sum = lastDigit_1 + lastDigit_2 + carry;
            ans.push_back((char)('0' + sum % 10));
            carry = sum / 10;

            if (!s.empty())
                s.pop_back();
            if (!t.empty())
                t.pop_back();
        }

        if (carry)
            ans.push_back((char)('0' + carry));

        reverse(ans.begin(), ans.end());

        if (ans.size() > 80)
            cout << "overflow" << endl;
        else
            cout << ans << endl;
    }
    return 0;
}

C++: #include <stdio.h>
#include <string.h>

int main(){
	int i,j,k,n,tmp,flag,length;
	int yosan[20];
	char str[81],str2[256];

	scanf("%d",&n);

	for(i = 0;i < n;i++){
		memset(yosan,0,sizeof(yosan));
		flag = 0;
		for(j = 0;j < 2;j++){
			scanf("%s",str2);
			length = strlen(str2);
			if(!flag && length >= 81){
				flag = 1;
			}else{
				memset(str,' ',sizeof(str));
				for(k = 0;k < 80;k++){
					if(k >= 80-length){
						str[k] = str2[k-80+length];
					}else{
						str[k] = '0';
					}
				}
				str[80] = '\0';
				//printf("%s\n",str);
				tmp = 0;
				for(k = 0;k < 80;k++){
					tmp *= 10;
					tmp += (str[k] - '0');
					if(k % 4 == 3){
						yosan[k/4] += tmp;
						tmp = 0;
					}
				}
				for(k = 29;k > 0;k--){
					if(yosan[k] >= 10000){
						yosan[k-1]++;
						yosan[k] %= 10000;
					}
				}
			}
		}
		if(yosan[0] >= 10000){
				flag = 1;
		}
		if(!flag){
			tmp = 0;
			while(yosan[tmp] == 0){
				tmp++;
			}
			printf("%d",yosan[tmp]);
			tmp++;
			for(j = tmp;j < 20;j++){
				printf("%04d",yosan[j]);
			}
			printf("\n");
		}else{
			printf("overflow\n");
		}
	}

	return 0;
}

C++: #include <cstdio>
#include <cmath>
#include <cstring>

using namespace std;

const int MAX_INPUT = 1000000;
const int ARRAY_SIZE = 9;
const int MAX_LEN = 8;
char inputA[MAX_INPUT];
char inputB[MAX_INPUT];

void toBigInt(char *str, long *r) {
    int len = strlen(str);
    int startIndex = ARRAY_SIZE - (len / MAX_LEN) - 1;

    {
        int offset = 0;
        for (int i = 0; i < ARRAY_SIZE; ++i) {
            char temp[MAX_LEN + 1] = { 0 };
            char* start = str + ((i == 0) ? 0 : offset);
            int readLen = ((len - offset) < MAX_LEN) ? len - offset : MAX_LEN;

            strncpy(temp, start, readLen);
            r[ARRAY_SIZE - i - 1] = (long)atoi(temp);
            offset += readLen;
        }
    }
}

int main() {
    while (scanf("%s\n%s", &inputA, &inputB) != EOF) {
        long a[ARRAY_SIZE] = { 0 };
        long b[ARRAY_SIZE] = { 0 };
        long r[10] = { 0 };
        int lenA = 0;
        int lenB = 0;
        const int MAX_INPUT_LEN = 80;
        lenA = strlen(&inputA[0]);
        lenB = strlen(&inputB[0]);
        if ((MAX_INPUT_LEN < lenA) || (MAX_INPUT_LEN < lenB)) {
            printf("overflow\n");
            continue;
        }

        toBigInt(inputA, a);
        toBigInt(inputB, b);
        for (int i = 0; i < ARRAY_SIZE; ++i) {
            int curRIndex = 10 - i - 1;
            r[curRIndex] += a[ARRAY_SIZE - i - 1] + b[ARRAY_SIZE - i - 1];
            const int MAX = 99999999;
            if (MAX < r[curRIndex]) {
                r[curRIndex - 1] = r[curRIndex] / (MAX + 1);
                r[curRIndex] %= (MAX + 1);
            }
        }

        {
            bool started = false;
            bool noOutput = true;
            for (int i = 0; i < 10; ++i) {
                if (!started && (0 < r[i])) {
                    started = true;
                    printf("%d", r[i]);
                    noOutput = false;
                    continue;
                }

                if (started) {
                    long temp = (r[i] == 0) ? 1 : r[i];
                    for (int j = 0; temp * pow(10, j) < 10000000; ++j) {
                        printf("0");
                    }

                    printf("%d", r[i]);
                }
            }

            if (noOutput) {
                printf("0");
            }
        }
        printf("\n");
    }

    return 0;
}