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

#define BUF_SIZE 256

int main(void) {
	char buf[BUF_SIZE];
	int num1[80];
	int num2[80];
	int sum[81];
	char str[82];
	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<80; j++) {
			num1[j] = num2[j] = 0;
		}
		for (j=0; j<81; j++) {
			sum[j]=0;
		}		
		
		fgets(buf, sizeof(buf), stdin);
		sscanf(buf, "%s", &str);
		j=k=0;
		while (str[j] != '\0')  j++;
		while (--j >= 0) num1[k++] = str[j] - '0'; 
		
		fgets(buf, sizeof(buf), stdin);
		sscanf(buf, "%s", &str);
		j=k=0;
		while (str[j] != '\0')  j++;
		while (--j >= 0) num2[k++] = str[j] - '0'; 
		
		for (j=0; j<80; j++) {
			sum[j] += num1[j]+num2[j];
			if (sum[j] >= 10) {
				sum[j+1] += 1;
				sum[j] = sum[j]%10;
			}
		}
		
		if (sum[80] != 0) {
			printf("overflow\n");
		}
		else {
			j=79;
			while (sum[j] == 0)  j--;
			for (; j>=0; j--) {
				printf("%d", sum[j]);
			}
			printf("\n");
		}
	}
	
	return 0;
}

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

using namespace std;

int main() {
    int N;
    cin >> N;
    while(N--) {
        string s1, s2;
        cin >> s1 >> s2;

        if(s1.size() > 80 || s2.size() > 80) {
            cout << "overflow" << endl;
            continue;
        }
        char buf[81] = {0};
        int p1 = s1.size()-1, p2 = s2.size()-1, pb = 79;
        int carry = 0;
        while(p2 >= 0) buf[pb--] = s2[p2--];
        pb = 79;
        while(pb >= 0 && (p1 >= 0 || carry > 0)) {
            int bd = buf[pb];
            if(bd > 0) bd -= '0';
            int bp = 0;
            if(p1 >= 0) bp = s1[p1--]-'0';
            int d = bp + bd + carry;
            carry = d / 10;
            d %= 10;
            buf[pb--] = d+'0';
        }
        while(pb >= 0 && buf[pb]) pb--;
        if(pb == -1 && carry > 0) cout << "overflow" << endl;
        else cout << (char*)(buf+(pb+1)) << endl;
    }
    return 0;
}

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

void str_plus(string &str, int d, int i){
  int keta = str.size()-i-1;//?????¨?¶??????????????????±???
  if(keta < 0){
    str.insert(0, "0");
    keta++;
  }
  int r = str[keta] - '0' + d;
  str[keta] = '0' + r % 10;
  if(r/10)
    str_plus(str, r/10, i+1);
}
int main(){
  int n;
  string str1, str2;
  cin >> n;
  for(int i = 0;i < n;i++){
    cin >> str1 >> str2;
    for(int i = 0; i < str2.size(); i++)
      str_plus(str1, str2[str2.size()-i-1]-'0', i);

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

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

int atoiLonger(char a[],long num[]){
	int length;
	int i,j=8,k=0;
	char temp[10];
	temp[9]='\0';
	length=strlen(a);
	for(j=0;j<9;j++){
		temp[j]='0';
	}
	j=8;
	for(i=length-1;i>=0;i--){
		temp[j]=a[i];
		if(j==0){
			num[k]=atoi(temp);
			k++;
			for(j=0;j<9;j++){
				temp[j]='0';
			}
			j=8;
		}else{
			j--;
		}
	}
	num[k]=atoi(temp);
	return 0;
}

int plus(long a[],long b[],long c[]){
	int temp,i,flag=0;
	for(i=0;i<9;i++){
		temp=a[i]+b[i]+flag;
		flag=0;
		if (temp>=1000000000){
			temp-=1000000000;
			flag=1;
		}
		c[i]=temp;
/*		printf("%dÚ:%d+%d=%d( Óê%d)\n",i,a[i],b[i],c[i],flag);
*/	}
	
	return flag;
}

int printLongNumber(long a[]){
	int i,flag=0;
	for(i=8;i>=0;i--){
		if(a[i]!=0 || flag==1){
			if (flag==0){
				printf("%d",a[i]);
				flag=1;
			}else{
				printf("%09d",a[i]);
			}
		}
	}
	
	printf("\n");
	return 0;
}

int scan(char a[]){
	a[81]='a';
	scanf("%s",a);
	if(a[81]!='a'){
		printf("overflow\n");
		scanf("%*s");
		return 1;
	}
	return 0;
}

int main(){
	char a[82],b[82];
	long numA[9],numB[9],numC[9];
	int i,j,cnt;
	scanf("%d",&cnt);
	for(j=0;j<cnt;j++){
		for(i=0;i<9;i++){
			numA[i]=0;
			numB[i]=0;
		}
		if(scan(a))continue;
		if(scan(b))continue;
	/*	printf("%s\n%s\n",a,b);
	*/	
		atoiLonger(a,numA);
		atoiLonger(b,numB);
		
		if(plus(numA,numB,numC)){
			printf("overflow\n");
			continue;
		}
		
	/*	printLongNumber(numA);
		printLongNumber(numB);
	*/	printLongNumber(numC);
	}
	return 0;
}

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

using namespace std;

int main(){
    
    string d[100000];
    string e[100000];
    
    stack<char> st1;
    stack<char> st2;
    stack<int> st3;
    int n=0;
    scanf("%d",&n);
    for(int i=0; i<n; i++){
        cin>>d[i];
        cin>>e[i];
    }
    
    for(int i=0; i<n; i++){
        //cin>>d;
        //cin>>e;
        
        for(int j=0; j<(int)(d[i].size()); j++){
            st1.push(d[i][j]);
        }
        for(int j=0; j<(int)(e[i].size()); j++){
            st2.push(e[i][j]);
        }
        int temp=0;
        char temp_char;
        while(st1.empty()==false||st2.empty()==false){
            if(st1.empty()==false&&st2.empty()==false){
                temp_char=st1.top();
                temp+=atoi(&temp_char);
                temp_char=st2.top();
                temp+=atoi(&temp_char);
                st1.pop();
                st2.pop();
            }else if(st1.empty()==false&&st2.empty()==true){
                temp_char=st1.top();
                temp+=atoi(&temp_char);
                st1.pop();
            }else if(st1.empty()==true&&st2.empty()==false){
                temp_char=st2.top();
                temp+=atoi(&temp_char);
                st2.pop();
            }
            st3.push(temp%10);
            temp=temp/10;
        }
        
        if(temp!=0){
            st3.push(temp);
        }
        
        if(st3.size()>=80){
            printf("overflow");
        }else{
            while(st3.empty()==false){
                printf("%d",st3.top());
                st3.pop();
            }
        }
        printf("\n");
        
        
    }
    
}