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 <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cstring>
#include <functional>

using namespace std;

#define REP(i,a,b) for((i)=(a);(i)<(int)(b);(i)++)
#define rep(i,n) REP(i,0,n)
// BEGIN CUT HERE
//#define foreach(c,itr) for(typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
//template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
// END CUT HERE

int main(){
  int i, j, n;

  scanf("%d",&n);
  rep(i,n){
    string str1, str2, res;
    cin >> str1;
    cin >> str2;
/*
    vector<int> a(82, 0), b(82, 0);
    rep(j,str1.length()){
      a[j] = str1[str1.length()-1-j] - '0';
      b[j] = str2[str2.length()-1-j] - '0';
    }

    rep(j,81){
      int sum = a[j] + b[j];
      if(sum >= 10){ sum %= 10; a[j+1]++;}
      res += (sum + '0');
    }

    reverse(res.begin(), res.end());
    bool f = false;
    rep(j,res.length()){
      if(res[j] != '0') f = true;
      if(f) cout << res[j];
    }
  */
    cout << endl;
  }

  return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  int n;
  cin >>n;
  while(n--){
    string a,b;
    cin >>a>>b;
    int num[900] = {0},tab = 0,i = 0;
    int as = a.size()-1;
    int bs = b.size()-1;
    int nmi = min(as,bs);
    int nma = max(as,bs);
    for(int x; i<=nma; i++){
      if(i<=nmi){x = tab+a[as-i]+b[bs-i]-'0'*2;}
      else if(as<bs){x = tab+b[bs-i]-'0';}
      else if(bs<as){x = tab+a[as-i]-'0';}
      tab = x/10;
      num[i] = x%10;
    }
    if(tab){num[nma+1] = tab;i++;}
    if(i>80){cout <<"overflow";}
    else{for(int x=i-1; x>=0; x--){cout <<num[x];}}
    cout <<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdlib>
#include<stdio.h>

int inttostring(char *x,int n){
  return sprintf(x,"%d",n);
}

int main(){
  std::string a;
  std::string b;
  char sum[102];
  int num_a,num_b;
  long long int num_sum,size_sum;
  int n;

  std::cin >> n;

  for(int i=0;i<n;i++){
    std::cin >> a >> b;
    num_a = std::atoi(&a[0]);
    num_b = std::atoi(&b[0]);

    num_sum = num_a+num_b;
    //sum = std::to_string(num_sum);

    size_sum = inttostring(sum,num_sum);

    if(size_sum>80){
      std::cout << "overflow" << std::endl;
      break;
    }

    std::cout << sum << std::endl;
  }
  //std::cout << num_a << std::endl;
  //std::cout << num_b << std::endl;
}

C++: 
#include <iostream>
#include <string>
#include <vector>
#include <utility> 
#include <tuple>
#include <algorithm>
#include <map>
#include <math.h>
using namespace std;


int main() {
int n;
cin>>n;
for(int y=0;y<n;y++){
string s,t;
cin>>s>>t;
	int ls=s.size(),lt=t.size();
if(ls>80||lt>80) cout<<"overflow"<<endl;
else{
	if(ls>lt){
		int r=ls-lt;
		while(r>0){
			t="0"+t;
		r=r-1;
		}
	}
	if(lt>ls){
		int r=-ls+lt;
		while(r>0){
			s="0"+s;
		r=r-1;
		}
	}
	
	int l=s.size();
	int q=0;
	string ans="";
	for(int k=0;k<l;k++){
		int w=t[l-k-1]-'0'+s[l-k-1]-'0';
		w=w+q;
//		cout<<w<<endl;
		char z='0'+w%10;
		ans=z+ans;
		q=w/10;
	}
	if(q==1) ans='1'+ans;
	if(q>0 && l==80)cout<<"overflow"<<endl;
	else 	cout<<ans<<endl;
	

}
	
	


}
	return 0;
}

C++: #include<iostream>
#include<string>

using namespace std;

int maxLength(const int &len1, const int &len2) {
	return len1 > len2 ? len1 : len2;
}


int main()
{
	int N;

	cin >> N;

	for (int i = 0; i < N; i++) {
		string s1, s2;
		cin >> s1 >> s2;
		//cout << s1 << endl << s2 << endl;
		int len1 = s1.size();
		int len2 = s2.size();
		int max = maxLength(len1, len2);
		if (max > 80) {
			cout << "overflow" << endl;
			continue;
		}

		int str[100] = {0};
		int acc = 0;
		for (int i = 0; i < max; i++) {
			if (len1 > i && len2 > i) {
				str[i] = (s1[len1-1-i] - '0') + (s2[len2-1-i] - '0') + acc;
			}
			else if(len1 > i) {
				str[i] = (s1[len1 - 1 - i] - '0') + acc;
			}
			else if (len2 > i) {
				str[i] = (s2[len2 - 1 - i] - '0') + acc;
			}
			acc = 0;
			if (str[i] > 9) {
				acc = 1;
				str[i] %= 10;
			}
		}
		if (max == 80 && acc == 1) {
			cout << "overflow" << endl;
			continue;
		}

		str[max] = acc;

		for (int i = acc == 1? max:max-1; i > -1; i--) {
			cout << str[i];
		}
		cout << endl;
	}

	return 0;
}