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<iostream>
#include<stdio.h>
#include<string.h>

int n;
char a[256], b[256];
int temp[100], temp2[100];

int main()
{
        std::cin >> n;
	
	while( n-- ){
		memset( temp, 0, sizeof( temp ) );
		memset( temp2, 0, sizeof( temp2 ) );
		
		std::cin >> a >> b;
		
		int maxlen = std::max( strlen( a ), strlen( b ) );
		
		if( maxlen > 79 ){
			std::cout << "overflow" << std::endl;
		 	continue;
		}
		
		for( int i = 0; i < strlen( a ); i++ ){
			temp[strlen( a ) - i - 1] = a[i] - '0';
		}
		
		for( int i = 0; i < strlen( b ); i++ ){
			temp2[strlen( b ) - i - 1] = b[i] - '0';
		}
		
		for( int i = 0; i < maxlen; i++ ){
			temp[i+1] += ( temp[i] + temp2[i] ) / 10;
			temp[i] = ( temp[i] + temp2[i] ) % 10;
		}
		
		if( temp[maxlen] ){
		 	if( maxlen + 1 > 79 ){
				std::cout << "overflow" << std::endl;
				continue;
			}
			
			std::cout << temp[maxlen];
		}
		
		for( int i = maxlen - 1; i >= 0; i-- ){
		 	std::cout << temp[i];
		}
		std::cout << std::endl;
	}

 	return 0;
}

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

#define N(c) (c-'0')

using namespace std;
 /*
	N	:整数文字列ペアの数
	ar[3][100]	:文字配列

 */



int main(){
	int i, j, k, n, s;
	char  ar[3][100], c;

  scanf("%d",&n);

  while(n--){
	  scanf("%s %s",ar[0],ar[1]);

	  for(i=0; i<2; i++){
		  j=strlen(ar[i]);
		  for(k=0; k<j/2; k++){
			  c=ar[i][k]; ar[i][k]=ar[i][j-k-1]; ar[i][j-k-1]=c;
		  }
	  }

    if(strlen(ar[0])<strlen(ar[1])){
      strcpy(ar[2], ar[1]); strcpy(ar[1], ar[0]); strcpy(ar[0], ar[2]);
    }

    i=strlen(ar[0]);
    j=strlen(ar[1]);
    for(k=0,s=0; k<j; k++){
      s += N(ar[0][k]) + N(ar[1][k]);
      ar[2][k]=(s%10)+'0';
      s=s/10;
    }

    for( ; k<i; k++){
      if(ar[0][k]=='\0')  ar[2][k]=s+'0';
      else{
        s += N(ar[0][j]);
        ar[2][k]=(s%10)+'0';         
        s=s/10;
      }
    }

    if(0==s)  ar[2][k]='\0';
    else {
      ar[2][k]=s+'0';
      ar[2][k+1]='\0';
    }

// printf("%s\n%s\n%s\n",ar[0],ar[1],ar[2]);


	  i=2;
		  j=strlen(ar[i]);
		  for(k=0; k<j/2; k++){
			  c=ar[i][k]; ar[i][k]=ar[i][j-k-1]; ar[i][j-k-1]=c;
		  }

  if(80<strlen(ar[2]))  	printf("overflow\n");
  else printf("%s\n",ar[2]);
	}
    return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){

  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    string a,b,out,tmp;
    cin >> a;
    cin >> b;
    //int m=max(a.size(),b.size());
    if(a.size()<b.size()){
      tmp=a;
      a=b;
      b=tmp;
    }
    //cout << a << endl;
    int si=-a.size()+b.size();
    for(int j=a.size()-1;j>=0;j--){
      if(j+si>=0){
	//cout << si << endl;
	a[j]+=b[j+si]-'0';
	//cout << a[j] << endl;
      }else{
	a[j]+=0;
	//cout << "!" << endl;
      }
      if(a[j]>'9'&&j!=0){
	a[j-1]++;
	a[j]-=10;
      }else if(a[j]>'9'&&j==0){
	a='1'+a;
	a[1]-=10;
	//for(int i=a.size();i>0;i--)
	//  a[i]=a[i-1];
	//a[1]-=10;
	//a[0]='1';
      }
    }
    if(a[81]!='\0')
      cout << "overflow" << endl;
    else
      cout << a << endl;
  }

}