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 <stdio.h>
#include <string.h>

int main(void){
  int N;
  scanf("%d", &N);

  int i,j,k;
  for(i=0; i<N; ++i){
    int digits[3][81];
    for(j=0; j<3; ++j){
      for(k=0; k<81; ++k){
        digits[j][k] = 0;
      }
    }

    for(j=0; j<2; ++j){
      char digit[80];
      scanf("%s", digit);
      for(k=0; k<strlen(digit); ++k){
        digits[j][k] = digit[strlen(digit)-1-k]-'0';
      }
    }
    
    for(j=0; j<80; ++j){
      digits[2][j] += (digits[0][j]+digits[1][j]);
      digits[2][j+1] += digits[2][j]/10;
      digits[2][j] %= 10;
    }

    int flag = 0;
    for(j=80; j>=0; --j){
      if(flag || digits[2][j]!=0){
        flag = 1;
        printf("%d", digits[2][j]);
      }
    }
    printf("\n");
  }
  
  return 0;
}

C++: #include<iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<sstream>
#include<algorithm>
#include<map>
#include<complex>
using namespace std;


#define li			long long int
#define rep(i,to)	for(int i=0;i<((int)(to));i++)
#define repp(i,start,to)	for(int i=(int)(start);i<((int)(to));i++)
#define pb			push_back
#define sz(v)		((li)(v).size())
#define bgn(v)		((v).begin())
#define eend(v)		((v).end())
#define allof(v)	(v).begin(), (v).end()
#define dodp(v,n)		memset(v,(li)n,sizeof(v))
#define bit(n)		(1ll<<(li)(n))
#define mp(a,b)		make_pair(a,b)
#define rin	rep(i,n)
#define EPS 1e-10
#define ETOL 1e-8
#define MOD 1000000007
#define p2(a,b)		cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)		cout<<a<<"\t"<<b<<"\t"<<c<<endl


int main(){
	li m;
	cin>>m;
	rep(k,m){
		string a,b;
		cin>>a>>b;
		li sa=sz(a),sb=sz(b);
		if(sa>sb)rep(i,sa-sb)b="0"+b;
		else rep(i,sb-sa)a="0"+a;
		
		p2(a,b);
		
		li n=sz(a);
		li co=0;
		vector<li> res;
		
		for(li i=n-1; i>=0; i--){
			li tmp=((a[i]-'0')+(b[i]-'0'))+co;
			if(tmp>9){
				co=1;
				tmp-=10;
			}
			else co=0;
			
			res.pb(tmp);
		}
		if(co>0)res.pb(1);
		
		if(sz(res)>80)puts("overflow");
		else{
			rep(i,sz(res)){
				cout<<res[sz(res)-i-1];
			}
			puts("");
		}
	}
	
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cstdint>

int main()
{
	std::uint32_t n;
	std::cin >> n;
	for (std::uint32_t i = 0; i < n; ++i) {
		typedef std::vector<char> BigNumArray;
		std::string str;

		std::cin >> str;
		BigNumArray num1(str.rbegin(), str.rend());

		std::cin >> str;
		BigNumArray num2(str.rbegin(), str.rend());

		if (num1.size() < num2.size()) {
			num1.resize(num2.size(), '0');
		}
		else {
			num2.resize(num1.size(), '0');
		}

		std::string result;
		std::uint16_t carry = 0;
		for (std::size_t i = 0; i < num1.size(); ++i) {
			std::uint16_t num = num1[i] - '0' + num2[i] - '0' + carry;
			carry = num / 10;
			result.push_back(num % 10 + '0');
		}
		if (carry == 1) {
			result.push_back('1');
		}

		if (result.size() > 80) {
			std::cout << "overflow" << std::endl;
		}
		else {
			std::copy(result.rbegin(), result.rend(),
					std::ostream_iterator<char>(std::cout, ""));
			std::cout << std::endl;
		}
	}
	return 0;
}

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(itr,c) 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;
  char tmp;

  scanf("%d",&n);
  rep(i,n){
    string str1, str2, res;
    cin >> str1;
    cin >> str2;

    vector<int> a(82, 0), b(82, 0);
    a[1] = str1.size();
    /*
    rep(j,str1.size()) a[j] = str1[(int)str1.size()-1-j] - '0';
    rep(j,str2.size()) b[j] = str2[(int)str2.size()-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());
    int f = 0;
    rep(j,res.size()){
      if(res[j] != '0') f = 1;
      if(f) cout << res[j];
    }

    cout << endl;
  }

  return 0;
}

C++: n = gets.to_i
n.times do
  a,b = gets.to_i,gets.to_i
  str = if (a+b) < 10**80 then (a+b) else "overflow" end
  puts str
end