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<string>
#include<vector>
#include<algorithm>
using namespace std;

int main(){
  int n;
   cin >> n;

   vector<int> V;

   for(int i = 0; i < n; i++){
     string a, b;
     int slength[2];

    
     cin >> a >> b;

     slength[0] = a.length();
     slength[1] = b.length();


     if(a.length() != 1)reverse(a.begin(), a.end());
     if(b.length() != 1)reverse(b.begin(), b.end());

     if(a.length() > b.length()){
       for(int j = 0; j < slength[0] - slength[1]; j++) b+="0";
     }else{
       for(int j = 0; j < slength[1] - slength[0]; j++) a+="0";
     }
     int flag = 0;

     for(int j = 0; j < a.length(); j++){
       if(flag){
	 a[j]++;
	 flag--;
       }
       if((a[j]+b[j]-96)/10 == 0){
	 V.push_back(a[j]+b[j]-96);
       }else{
	 flag++;
	 V.push_back((a[j]+b[j]-96)%10);
       }
     }
 
     if(flag) V.push_back(1);

     if(V.size()-1 >= 80){
       cout << "overflow" <<endl;
     }else{
       for(int j = V.size()-1; j >= 0; j--){
	 cout << V[j];
       }
       cout << endl;
     }
     V.clear();
   }  
   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;

  cin >> 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 <vector>
#include <string>
using namespace std;

int main(){
	string a, b;
	vector<int> ans;
	int n, num, ai, bi, c=0;
	bool flag;
	cin >> n;
	for(int i=0 ; i<n ; i++){
		cin >> a >> b;
		flag = false;
		for(int j=0 ; j<100 ; j++){
			num = 0;
			ai = a.size()-j-1;
			bi = b.size()-j-1;
			if( ai<0 && bi<0 && c==0) break;

			if(ai>=0)num += a[ ai ] - 48;
			if(bi>=0)num += b[ bi ] - 48;
			ans.push_back( (num+c)%10 );
			if(num+c >= 10) c = 1;
			else c = 0;
		}
		if(ans.size()>80){
			printf("overflow");
		}else{
			for(int j=ans.size()-1 ; j>=0 ; --j){
				printf("%d", ans[j]);
			}
		}
		printf("\n");
		ans.clear();
	}
	return 0;
}

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

using namespace std;

const int N = 85;

char a[N], b[N];

void reverse(char a[]) {
	int len = strlen(a);
	for (int i=0, j=len-1; i<j; ++i, --j) {
		char tmp = a[i];
		a[i] = a[j];
		a[j] = tmp;
	}
}

void add(char a[], char b[]) {
	int lenA = strlen(a);
	int lenB = strlen(b);
	int i, j, tmp, jin = 0;
	for (i=0; i<lenA && i<lenB; ++i) {
		tmp = (a[i] - '0') + (b[i] - '0') + jin;
		a[i] = tmp % 10 + '0';
		jin = tmp / 10;  
	}
	if (!a[i] && !b[i] && jin) {
		a[lenA] = jin + '0';
		a[lenA + 1] = '\0';
	}
	else if (a[i] && !b[i] && jin) {
		for (; i<lenA; ++i) {
			tmp = a[i] - '0' + jin;
			a[i] = tmp % 10 + '0';
			jin = tmp / 10;
		}
		if (jin) {
			a[lenA] = jin + '0';
			a[lenA + 1] = '\0';
		} 
	}
	else if (!a[i] && b[i] && jin) {
		for (; i<lenB; ++i) {
			tmp = b[i] - '0' + jin;
			a[i] = tmp % 10 + '0';
			jin = tmp / 10;
		}
		if (jin) {
			a[lenB] = jin + '0';
			a[lenB + 1] = '\0';
		}
		else a[lenB] = '\0';
	}
}

int main() {
	int t;
	scanf ("%d", &t);
	while (t--) {
		scanf ("%s%s", a, b);
		if (strlen(a) > 80 || strlen(b) > 80) printf ("overflow\n");
		else {
			reverse(a);
			reverse(b);
			add(a, b);
			if (strlen(a) > 80) printf ("overflow\n");
			else reverse(a), printf ("%s\n", a);
		}
	}
	return 0;
}