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 <cstdio>
#include <cstring>
using namespace std;
#define def 1000

int main(void){
  int i,j,n,len,tmp,max,digits,A[def],B[def],C[def];
  char str[def];

  fgets(str,sizeof(str),stdin);
  sscanf(str,"%d",&n);
  for(i=0;i<n;i++){
    memset(A,0,sizeof(A));
    memset(B,0,sizeof(B));
    memset(C,0,sizeof(C));
    tmp = 0;
    digits = 0;
    /*for(j=0;j<5;j++){
      printf("%d",A[j]);
    }
    printf("\n");*/
    fgets(str,sizeof(str),stdin);
    len = strlen(str)-2;
    max = len;
    digits = max+1;
    //printf("%d\n",len);
    for(j=len;j>=0;j--){
      A[len-j] = str[j]%48;
      //printf("%d",A[len-j]);
    }
    //printf("\n");
    fgets(str,sizeof(str),stdin);
    len = strlen(str)-2;
    if(len>max){
      max = len;
      digits = max+1;
    }
    for(j=len;j>=0;j--){
      B[len-j] = str[j]%48;
      //printf("%d",A[len-j]);
    }
    for(j=0;j<=max;j++){
      //printf("%d ",(A[j] + B[j] + tmp)%10);
      C[max+1-j] = (A[j] + B[j] + tmp)%10;
      tmp = (A[j] + B[j] + tmp)/10;
      //printf("%d\n",tmp);
      if(j==max && tmp!=0){
        C[0] = tmp;
        digits += 1;
      }
      if(digits>80){
        printf("overflow");
        goto end;
      }
      //printf("%d",B[len-j]);
    }
    for(j=0;j<=max+1;j++){
      if(j==0 && C[j]==0) continue;
      printf("%d",C[j]);
    }
    end:;
    printf("\n");
    //Calculation(A,B);
  }
  return 0;
}

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

int main(){
  std::string str1,str2,sumstr;
  while(std::cin>>str1>>str2){
    sumstr.clear();
    std::reverse(str1.begin(),str1.end());
    std::reverse(str2.begin(),str2.end());
    unsigned size=std::min(str1.size(),str2.size());
    unsigned i;
    unsigned carry=0;
    for(i=0;i<size;++i){
      unsigned sum=str1[i]+str2[i]+carry-'0'*2;
      sumstr.push_back(sum%10+'0');
      carry=sum/10;
    }
    std::string large=(str1.size()>str2.size())?str1:str2;
    for(;i<large.size();++i){
      unsigned sum=large[i]+carry-'0';
      sumstr.push_back(sum%10+'0');
      carry=sum/10;
    }
    if(carry)sumstr.push_back(carry+'0');
    std::reverse(sumstr.begin(),sumstr.end());
    sumstr.push_back('\0');
    if(sumstr.size()<=81&&str1.size()<=81&&str2.size()<=81)
      std::cout<<sumstr<<std::endl;
    else
      std::cout<<"overflow"<<std::endl;
  }
}

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

int main(){
	int N;
	char str1[90], str2[90];
	int num1[80], num2[80], sum[80];
	int pos, pos2, up;
	
	scanf("%d", &N);
	while(N--){
		for(int i = 0; i < 90; i++){
			str1[i] = 0;
			str2[i] = 0;
		}
		for(int i = 0; i < 80; i++){
			num1[i] = 0;
			num2[i] = 0;
			sum[i] = 0;
		}
		scanf("%s", str1);
		scanf("%s", str2);
		
		pos = 89;
		while(str1[pos] == 0) pos--;
		pos2 = 0;
		while(str1[pos] != 0){
			num1[pos2++] = str1[pos--] - 48;
		}
		pos = 89;
		while(str2[pos] == 0) pos--;
		pos2 = 0;
		while(str2[pos] != 0){
			num2[pos2++] = str2[pos--] - 48;
		}
		
		up = 0;
		for(int i = 0; i < 80; i++){
			sum[i] = num1[i] + num2[i] + up;
			up = sum[i] / 10;
			sum[i] = sum[i] % 10;
		}
		
		if(up > 0 || sum[79] > 0) printf("overflow\n");
		else{
			pos = 79;
			while(sum[pos] == 0) pos--;
			while(pos >= 0){
				printf("%d", sum[pos--]);
			}
			printf("\n");
		}
	}
	
	return 0;
}

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

#define BUF_SIZE 256

int main(void) {
	char buf[BUF_SIZE];
	int num1[100];
	int num2[100];
	int sum[100];
	char str[100];
	int n;
	int i, j, k;
	
	fgets(buf, sizeof(buf), stdin);
	sscanf(buf, "%d", &n);
	
	for (i=0; i<n; i++) {
		for (j=0; j<100; j++) {
			num1[j] = num2[j] = sum[j] = 0;
		}
		
		// first integer
		fgets(buf, sizeof(buf), stdin);
		sscanf(buf, "%s", &str);
		if (strlen(str) > 80) {
			printf("overflow\n");
		}
		
		for (j=0; j<strlen(str)-1; j++)  ;
		for (k=0; j>=0; k++) {
			num1[k] = str[j] - '0';
			j--;
		}
		
		// second integer
		fgets(buf, sizeof(buf), stdin);
		sscanf(buf, "%s", &str);
		if (strlen(str) > 80) {
			printf("overflow\n");
		}
		
		for (j=0; j<strlen(str)-1; j++)  ;
		for (k=0; j>0; k++) {
			num2[k] = str[j] - '0';
			j--;
		}
		
		// sum
		for (j=0; j<80; j++) {
			sum[j] += num1[j]+num2[j];
			if (sum[j]/10 >= 1) {
				sum[j+1] += sum[j]/10;
				sum[j] = sum[j]%10;
			}
		}
		
		if (sum[80] > 0) {
			printf("overflow\n");
		}
		else {
			for (j=79; sum[j]==0 && j!=0; j--)  ;
			for (; j>=0; j--) {
				printf("%d", sum[j]);
			}
			printf("\n");
		}
	}
	
	return 0;
}

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

int n;
char a[256], b[256];

int main()
{
        std::cin >> n;
	
	while( n-- ){
		char c[256];
		
		std::cin >> a >> b;
		
		int minlen = std::min( strlen( a ), strlen( b ) );
		int maxlen = std::max( strlen( a ), strlen( b ) );
		bool f = strlen( a ) > strlen( b );
		bool f2 = false;
		
		if( maxlen > 80 ){
		 	std::cout << "overflow" << std::endl;
			continue;
		}
		
		int sz = 0;
		int carry = 0;
		
		for( int i = 0; i < minlen; i++ ){
			int na = a[ strlen( a ) - 1 - i ] - '0';
			int nb = b[ strlen( b ) - 1 - i ] - '0';
			int nc = 0;
			
			if( na + nb + carry >= 10 ){
			 	nc = na + nb + carry - 10;
				carry = 1;
			}
			else{
			 	nc = na + nb + carry;
				carry = 0;
			}
			c[ maxlen - i - 1 ] = nc + '0';
		}
		
		for( int i = minlen; i < maxlen; i++ ){
			int na = f ? a[ maxlen - 1 - i ] - '0' : b[ maxlen - 1 - i ] - '0';
			int nc = 0;
			
			if( na + carry >= 10 ){
			 	nc = na + carry - 10;
				carry = 1;
				if( i == maxlen - 1 ){
					f2 = true;
				}
			}
			else{
			 	nc = na + carry;
				carry = 0;
			}
			
			c[ maxlen - i - 1 ] = nc + '0';
		}
		
		sz = maxlen + f2;
		
		if( sz >= 80 ){
		 	std::cout << "overflow" << std::endl;
		}
		else{
			c[sz-(f2?1:0)] = '\0';
			if( f2 )std::cout << "1";
			std::cout << c << std::endl;
		}
		sz = 0;
		carry = 0;
	}

 	return 0;
}