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<vector>
#include<algorithm>
using namespace std;
vector<int> sum(string A, string B);
int main() {
  string a="99999999999999999999999999999999999999999999999999999999999999999999999999999999";
  string b="0";
    if((int)a.size()>80 || (int)b.size()>80)
      cout<<"overflow\n";
    else{
      vector<int> tmp=sum(a,b);
      if(tmp.size()>80)
	cout<<"overflow\n";
      else {
	string *s=new string[tmp.size()];
	for(int i=0;i<(int)tmp.size();i++) {
	  s[i]=to_string(tmp[i]);
	  cout<<s[i];
	}
	cout<<endl;
      }
    }
  return 0;
}
vector<int> sum(string A, string B) {
  int  a_size=A.size()-1;
  int  b_size=B.size()-1;
  int end=-1;
  vector<int> tmp;
  int Dr=0;
  while(true) {
    if(a_size<0 ){
      end=0;
      break;
    }
    if(b_size<0){
      end=1;
      break;
    }
    int a=(int)A[a_size]-(int)'0';
    int b=(int)B[b_size]-(int)'0';
    int n=a+b+Dr;
    if(n>=10){
      tmp.push_back(n-10);
      Dr=1;
    }
    else{
      Dr=0;
      tmp.push_back(n);
    }
    a_size--;
    b_size--;
  }

  if(end==0) {
    for(int i= b_size;i>=0;i--){
      int n=(int)B[b_size]-int('0')+Dr;
      if(n>=10) {
	tmp.push_back(n-10);
	Dr=1;
      }
      else{
	tmp.push_back(n);
	Dr=0;
      }
    }
  }
  else if(end==1){
    for(int i=a_size;i>=0;i--){
      int n=(int)A[a_size]-int('0')+Dr;
      if(n>=10){
	tmp.push_back(n-10);
	Dr=1;
      }
      else{
	tmp.push_back(n);
	Dr=0;
      }
    }
  }
  if(Dr==1)
    tmp.push_back(1);
  reverse(tmp.begin(),tmp.end());
  return tmp;
}

C++: #include <stdio.h>

#define DEGITS 80

int load(int a[]);
void print(int a[]);

int main(void){
    int a[DEGITS]; // a[0] = LSD
    int b[DEGITS];
    int n;
    int cry;
    
    scanf("%d", &n);
    for (int i=0; i<n; i++){
        // reset
        for (int i=0; i<DEGITS; i++){
            a[i]=b[i]=0;
        }
        // load
        if (load(a)){
            printf("overflow\n");
            load(b);
            continue;
        }
        if (load(b)){
            printf("overflow\n");
            continue;
        }        // add ( a <- a + b )
        cry=0;
        for (int d=0; d<DEGITS; d++){
            a[d] += (b[d] + cry);
            cry = a[d]/10;
            if (a[d]>9){
                a[d]-=10;
            }
        }
        // print
        if (cry){
            printf("overflow\n");
        } else{
            print(a);
        }
    }

    return 0;
}

int load(int a[]){
    char *pt;
    char st[DEGITS+1];
    int i;
    
    scanf("%s", st);
    for (pt=st, i=0; *pt!='\0'; pt++, i++) ;
    if (i>DEGITS) return 1;
    for (int i=0; pt!=st; i++){
        a[i] = *(--pt)-'0';
    }
    return 0;
}

void print(int a[]){
    int d;
    
    for (d=DEGITS-1; d>0; d--){ 
        if (a[d] != 0) break;
    }
    for (; d>0; d--) printf("%d", a[d]);
    printf("%d\n", a[0]);
}

C++: #include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main() {
	int N;
	cin>>N;
	for(int i=0;i<N;i++) {
		string A,B,C;
		cin>>A>>B;
		reverse(A.begin(),A.end());
		reverse(B.begin(),B.end());
		if(A.size()>80||B.size()>80) {
			cout<<"overflow"<<endl;
			continue;
		}
		for(int i=0;i<A.size()||i<B.size();i++) {
			int n=0;
			if(i<A.size())n+=(A[i]-'0');
			if(i<B.size())n+=(B[i]-'0');
			C.push_back(n);
		}
		for(int i=0;i<C.size();i++) {
			if(i!=C.size()-1)C[i+1]+=C[i]/10,C[i]%=10;
		}
		reverse(C.begin(),C.end());
		if(C.size()>80) {
			cout<<"overflow"<<endl;
		}else {
			for(int i=0;i<C.size();i++) {
				if(C[i]>=10) {
					cout<<(char)(C[i]/10+'0');
					cout<<(char)(C[i]%10+'0');
				}else cout<<(char)(C[i]+'0');
			}
			cout<<endl;
		}
	}
}

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

int main(void){
	int n = 0;
	char i1[100], i2[100], o[100];
	int li1=0, li2 = 0;
	int d1[81], d2[81], d[81];
	int c = 0;

	scanf("%d", &n);
	for(int i=0; i<n; ++i){
		c = 0;
		scanf("%s", i1);
		scanf("%s", i2);
		li1 = strlen(i1);
		li2 = strlen(i2);
		if(li1 > 80 || li2 > 80){
			puts("overflow");
			continue;
		}
		for(int j=0;j<81;++j){
			d1[j] = d2[j] = d[j] = 0;
		}
		for(int j=0;j<li1;++j){
			d1[j] = *(i1 + li1 - j - 1) - '0';
		}
		for(int j=0;j<li2;++j){
			d2[j] = *(i2 + li2 - j - 1) - '0';
		}
		for(int j=0;j<81; ++j){
			d[j] = d1[j] + d2[j] + c;
			c = d[j] >= 10 ? 1 : 0;
			d[j] -= 10 * c;
		}
		for(c=80; c>=0; --c){
			if(d[c] != 0){
				break;
			}
		}
		if(c == 80){
			puts("overflow");
			continue;
		}
		for(int j = 0; j<=c; ++j){
			o[j] = d[c - j] + '0';
		}
		o[c + 1] = '\0';
		printf("%s\n", o);
	}
	return 0;
}