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<cstring>
#include<string>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
    char num1[100],num2[100];
    char sum[100],temp;
    int a,b,q,r,i,big,small,j,testcase;
    cin>>testcase;
    while(testcase--){
        scanf("%s %s",&num1,&num2);
        int len1=strlen(num1);
        int len2=strlen(num2);
        if(len1>80 || len2>80){
            cout<<"overflow\n";
            continue;
        }
        reverse(num1,num1+len1);
        reverse(num2,num2+len2);

        if(len1>len2){
            big=len1;
            small=len2;
        }
        else{
            big=len2;
            small=len1;
        }
        r=0;
        for(i=0;i<small;i++){
            a=num1[i]-48;
            b=num2[i]-48;
            if(a+b+r>9){
                q=(a+b+r)-10;
                r=1;
                sum[i]=q+48;
            }
            else{
                q=a+b+r;
                r=0;
                sum[i]=q+48;
            }
        }
        if(len1>len2){
            for(;i<big;i++){
                a=num1[i]-48;
                a+=r;
                if(a>9){
                    q=a-10;
                    r=1;
                    sum[i]=q+48;
                }
                else{
                    q=a;
                    r=0;
                    sum[i]=q+48;
                }
            }
        }
        else{
            for(;i<big;i++){
                a=num2[i]-48;
                a+=r;
                if(a>9){
                    q=a-10;
                    r=1;
                    sum[i]=q+48;
                }
                else{
                    q=a;
                    r=0;
                    sum[i]=q+48;
                }
            }
        }
        if(r>0){
            q=r;
            sum[i]=q+48;
            sum[++i]='\0';
        }
        else{
            sum[i]='\0';
        }
        j=strlen(sum);
        if(j>80){
            cout<<"overflow\n";
        }
        else{
            reverse(sum,sum+j);
            cout<<sum<<endl;
        }
    }
    return 0;
}

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


int main(){
  int n,i,j;
  
  
  int up = 0;
  cin >> n;
  for(i=0;i<n;i++){
    int sum[110]={};
    string a,b;
    up = 0;
    cin >> a >> b;
    int sa=a.size(),sb=b.size();
    int flag=0;
    if(max(sa,sb)>80) flag =1;
    else 
    for(j=0;j<max(sa,sb);j++){
      if(sa>j&&sb>j){
	sum[j] = (a[sa-j-1]-'0') + (b[sb-j-1]-'0') + up;
      }else if(sa>j){
	sum[j] = (a[sa-j-1]-'0') + up;
      }else if(sb>j){
	sum[j] = (b[sb-j-1]-'0') + up;
      }
      up=0;
      if(sum[j]>9){
	up=1;
	sum[j]-=10;
      }
    }
    sum[max(sa,sb)]=up;
    int k=max(sa,sb);
    while(sum[k]==0&&k>0) k--;
    if(k>=80||flag==1) cout << "overflow";
    else
    for(j=k;j>=0;j--)
      cout << sum[j];
    cout << endl;
  }
}

C++: #include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(){
	long int io[11],it[11],three[11];
	int n,a,b,c,xo,xt,x;
	char one[80],two[80],t[8];
	scanf("%d",&n);
	for(a=0;a<n;a++){
		scanf("%s",&one);
		scanf("%s",&two);
		xo=strlen(one)/8;
		xt=strlen(two)/8;
		if(xo<xt){x=xt;}
		else{x=xo;}
		for(b=0;b<11;b++){
			three[b]=0;
		}
		for(b=0;b<10;b++){
			for(c=0;c<8;c++){
				t[c]=one[c+b*8];
			}
			io[b]=atoi(t);
		}
		for(b=0;b<10;b++){
			for(c=0;c<8;c++){
				t[c]=two[c+b*8];
			}
			it[b]=atoi(t);
		}
		for(b=0;b<=x;b++){
			three[b]+=io[b]+it[b];
			three[b+1]+=three[b]/100000000;
			three[b]=three[b]%100000000;
		}
/*		if(three[10]==0){
			printf("%ld",three[x]);
			for(b=1;b<=x;b++){
				printf("%08ld",three[x-b]);
			}
			printf("\n");
		}
		else{printf("overflow\n");}*/
	}
	return 0;
}