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<cstdio>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
int main(){

	int n;
	cin >> n;
	while(n > 0){
        char a[120] = {0};
        char b[120] = {0};
        scanf("%s%s",a,b);
        int len_a = 0,len_b = 0;
        //長さを測る
        for(int i = 0; a[i] != 0; i++) len_a++;
        for(int i = 0; b[i] != 0; i++) len_b++;
        //もし80桁を超えてたらoverflowと出力
        if(len_a > 80 || len_b > 80){
            printf("overflow\n");
        }
        //80桁を超えてなかったら
        else{
            char ans[120] = {0};
            //aを逆向きに入れ替える
            for(int i = 0; i < len_a/2; i++){
                swap(a[i],a[len_a-i-1]);
            }
            //bを逆向きに入れ替ええる
            for(int i = 0; i < len_b/2; i++){
                swap(b[i],b[len_b-i-1]);
            }
            //aとbで長い方の長さをとる
            int len = max(len_a,len_b);
            //ここで足し算をする
            for(int i = 0; i < len; i++){
                if(ans[i] != 0){
                    if(a[i] == 0 || b[i] == 0)
                        ans[i] += a[i] + b[i] - '0';
                    else ans[i] += a[i] + b[i] - '0' - '0';

                }
                else if(a[i] == 0 || b[i] == 0) ans[i] += a[i] + b[i];
                else ans[i] += a[i] + b[i] - '0';
                if(ans[i] >= 58){
                    ans[i+1]+='1';
                    ans[i] -= 10;
                }
            }
            //このままではansが逆向きなので入れ替える
            for(int i = 0; i < strlen(ans)/2; i++){
                swap(ans[i],ans[strlen(ans)-i-1]);
            }
            
            int len_ans = 0;
            //ansの長さを測る
            for(int i = 0; ans[i] != 0; i++) len_ans++;
            //もし80桁を超えていたらoverflowと出力する
            if(len_ans > 80) printf("overflow");
            //それ以外なら一文字ずつ出力
            else for(int i = 0; ans[i] != 0; i++) printf("%c",ans[i]);
            printf("\n");
        }
        n--;
	}

	return 0;
}

C++: #include <array>
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>

using namespace std;

typedef array<int, 11> BigInt;

string BigInt2String(BigInt bi) {
  reverse(bi.begin(), bi.end());
  char buf[89] = {};
  char *pos = buf;
  for (auto i : bi) {
    sprintf(pos, "%08d", i);
    pos += 8;
  }
  string result(buf);
  return result.substr(result.find_first_not_of('0'));
}

BigInt String2BigInt(const string& s) {
  BigInt bi { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };

  string t(s);
  int i = 0;
  while (!t.empty()) {
    size_t offset = t.size() < 8 ? 0 : t.size() - 8;
    bi[i++] = atoi(t.substr(offset).c_str());
    t = t.substr(0, offset);
  }
  return bi;
}

string AddBig(const string& x, const string& y) {
  if (x.size() > 80 || y.size() > 80) { return string("overflow"); }

  BigInt x_bi = String2BigInt(x);
  BigInt y_bi = String2BigInt(y);
  BigInt sum { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };
  for (int i = 0; i < x_bi.size(); ++i) {
    sum[i] += x_bi[i] + y_bi[i];
    if (sum[i] > 99999999) {
      sum[i + 1] = 1;
      sum[i] -= 100000000;
    }
  }
  if (sum[10] != 0) { return string("overflow"); }
  return BigInt2String(sum);
}

int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string x, y;
    cin >> x;
    cin >> y;
    cout << AddBig(x, y) << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<string>
//ðÇÁ·é
void addplace(unsigned int *a, unsigned int *last, int num){
	if( a == last ) return; //[·¬ÜÛÀ
	
	int carry = (*a * 10 + num) / 100000000;
	addplace(a+1, last, carry);
	*a = (*a * 10 + num) % 100000000;
}
bool trace(unsigned int *a, unsigned int *last){
	if( a == last ) return false; //[·¬ÜÛÀ
	if( !trace(a+1, last) ){
		if( *a > 0 ){
			std::cout << *a;
			return true;
		}
	}else{
		char b[11]={};
		sprintf(b,"%d",*a+100000000);
		std::cout<<b+1;
		return true;
	}
	return false;
}
void add(unsigned int *a, unsigned int *alast, unsigned int *b, int num=0){
	if( a == alast ) return; //[·¬ÜÛÀ
	
	int carry = (*a + *b + num) / 100000000;
	add(a+1, alast, b+1, carry);
	*a = (*a + *b + num) % 100000000;
}
int main(){
	int n;
	std::cin>>n;
	std::string a,b;
	std::getline(std::cin, a);//üsÇÝÌÄ
	for(;n--;){
		std::getline(std::cin, a);
		std::getline(std::cin, b);
		//uint ½è1 0000 0000-1ÜÅJEg·é
		unsigned int _a[11]={},_b[10]={};
		for(std::string::iterator it=a.begin();
			it!=a.end(); it++){
			addplace(_a, _a+10, *it-'0');
		}
		for(std::string::iterator it=b.begin();
			it!=b.end(); it++){
			addplace(_b, _b+10, *it-'0');
		}
		add(_a, _a+11, _b);
		if( _a[10] >= 1 ){
			std::cout<<"overflow\n";
		}else{
			trace(_a, _a+10);
			std::cout<<'\n';
		}
	}
}