Go: package main

import (
        "fmt"
        "bufio"
        "os"
)

func main() {
        var n int
        var a, b string
        sc := bufio.NewScanner(os.Stdin)
        fmt.Scanf("%d", &n)
        for i := 0; i < n; i++ {
                sc.Scan()
                a = sc.Text()
                sc.Scan()
                b = sc.Text()

                if len(a) > len(b) {
                        s := add(a, b)
                        if s[len(a)] > 0 {
                                if len(a) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(a)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                } else {
                        s := add(b, a)
                        if s[len(b)] > 0 {
                                if len(b) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(b)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                }
        }
}

// expects ln > lm
func add(n string, m string) (s [100]int) {
        ln := len(n)
        lm := len(m)
        var sum [100]int

        for i := 0; i < ln; i++ {
                var s, t int
                s = int(n[ln-1-i]) - int('0')

                if lm - 1 - i >= 0 {
                        t = int(m[lm-1-i]) - int('0')
                } else {
                        t = 0
                }

                sum[i+1] = (s + t + sum[i]) / 10
                sum[i] = (s + t + sum[i]) % 10
        }

        return sum
}

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;
}