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 <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int main() {
    int n, m = 103;
    cin >> n;
    while (n--){
        string sa, sb;
        VI a(m), b(m);
        cin >> sa >> sb;
        REP(i,sa.length()) a[i] = sa[sa.length()-i-1] - '0';
        REP(i,sb.length()) b[i] = sb[sb.length()-i-1] - '0';
        int p = 0;
        REP(i,m){
            a[i] += b[i] + p;
            if (a[i] >= 10){
                a[i] -= 10;
                p = 1;
            }else{
                p = 0;
            }
        }
        int h = 0;
        REP(i,m) if (a[i] > 0) h = i;
        if (h >= 80){
            cout << "overflow" << endl;
        }else{
            FORR(i,h,0) cout << a[i];
            cout << endl;
        }
    }

    return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<stdlib.h>
#include<time.h>
#include<math.h>
using namespace std;
int a[110],b[110],c[110];
char x[110],y[110];
void ff(char z[110])
{
    int d=strlen(z);
    for(int i=0;i<d/2;i++)
    {
        swap(z[i],z[d-1-i]);
    }

}
int main()
{
   int n;
   scanf("%d",&n);
   while(n--)
   {
       memset(a,0,sizeof(a));
       memset(b,0,sizeof(b));
       memset(c,0,sizeof(c));
       scanf("%s",x);
       scanf("%s",y);
      ff(x),ff(y);
     for(int i=0;i<strlen(x);i++)
     {
         a[i]=x[i]-'0';
     }
     for(int i=0;i<strlen(y);i++)
     {
         b[i]=y[i]-'0';
     }
     int d=0,s;
      for(int i=0;i<110;i++)
      {
          s=a[i]+b[i]+d;
         c[i]=s%10;
         d=s/10;
      }
      int p=0;
      for(int i=109;i>=0;i--)
      {
          if(c[i])
          {
              p=i;
              break;
          }
      }
      if(p>=80)
      {
          printf("overflow\n");
         
      }
      else
        {
          for(int i=p;i>=0;i--)
          {
              printf("%d",c[i]);
          }
          printf("\n");
      }
   }
}

C++: #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main(){
	string a,b;
	vector<int> ans;
	int n,tmp,carry,num;
	cin >> n;
	for(int i=0; i<n; i++){
		ans.clear();
		cin >> a >> b;
		int ai = a.size()-1;
		int bi = b.size()-1;
		carry=0;
		if(a.size() > 80 || b.size() > 80){
			cout << "overflow" << endl;
		}
		while(ai >= 0 || bi >= 0){
			tmp=0;
			if(ai >= 0) tmp += a[ai] - '0';
			if(bi >= 0) tmp += b[bi] - '0';
			ans.push_back((tmp+carry)%10);
			carry = (tmp+carry)/10;
			ai--; bi--;
		}
		if(carry != 0) ans.push_back(carry);
		if(ans.size() > 80){
			cout << "overflow" << endl;
		}
		
		for(int j=ans.size()-1; j>=0; j--)
			cout << ans[j];
		cout << endl;
	}
	return 0;
}

C++:  #include<iostream>
#include<stdio.h>
#include <algorithm>
#include<string.h>
#include <utility>
using namespace std;
using namespace std;
int main(){
	int m;
	string in,in2;
	int a[90],b[90],ans[90];
	int f;
	int alen,blen,mlen;
	cin>>m;
	while(m--){
		for(int i=0;i<90;i++){
			a[i]=b[i]=ans[i]=0;
		}
		cin>>in;
		cin>>in2;
		alen=in.size();
		blen=in2.size();
		for(int i=0;i<alen;i++){
			a[alen-1-i]=in[i]-'0';
		}
		for(int i=0;i<blen;i++){
			b[blen-1-i]=in[i]-'0';
		}
		mlen=max(alen,blen);
		if(mlen>80){
			cout<<"overflow"<<endl;
			continue;
		}
		f=0;
		for(int i=0;i<mlen+1;i++){
			ans[i]=(a[i]+b[i]+f)%10;
			f=(a[i]+b[i]+f)/10;
		}
		if(ans[mlen]!=0){
			//if(mlen>79){
				//cout<<"overflow"<<endl;
				//continue;
			//}
			//cout<<ans[mlen];
		}
		
		for(int i=0;i<mlen;i++){
			//cout<<ans[mlen-1-i];
		}cout<<endl;
		
		
	}
	return 0;
}