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<vector>
#include<iostream>
#include<iomanip>
#include<string>
#include<cstdlib>

typedef std::vector<int> bignum;

const int e9=1000000000;

bignum plus(const bignum& a,const bignum& b);
bignum minus(const bignum& a,const bignum& b);
void output(const bignum& num);
int compare(const bignum& a,const bignum& b);
bignum newnum(const std::string& str);

int main()
{
	bignum a,b,sum;
	std::string str;
	int n;
	std::cin>>n;
	for(int i=0;i<n;i++)
	{
		std::cin>>str;
		a=newnum(str);
		std::cin>>str;
		b=newnum(str);
		sum.clear();
		sum=plus(a,b);
		if(compare(sum,newnum("10000000000000000000000000000000000000000000000000000000000000000000000000000000"))>0)
		{
			std::cout<<"overflow"<<std::endl;
		}
		else
		{
			output(sum);
		}
	}
}

bignum plus(const bignum& a,const bignum& b)
{
	bignum sum;
	int carry=0;
	long long temp;
	for(int i=0;i<((a.size()>b.size())?a.size():b.size())||carry==1;i++)
	{
		temp=carry;
		carry=0;
		if(i<a.size())
		{
			temp+=a[i];
		}
		if(i<b.size())
		{
			temp+=b[i];
		}
		sum.push_back(temp%e9);
		if(temp>=e9)
		{
			carry=1;
		}
	}

	return sum;
}

int compare(const bignum& a,const bignum& b)
{
	if(a.size()>b.size()){return 1;}
	else if(a.size()<b.size()){return -1;}
	else
	{
		for(int i=a.size()-1;i>=0;i--)
		{
			if(a[i]>b[i]){return 1;}
			else if(a[i]<b[i]){return -1;}
		}
	}
	return 0;
}

bignum newnum(const std::string& str)
{
	bignum num;
	int len;
	for(int i=str.size();i>=0;i-=9)
	{
		len=9;
		if(i<9)len=i;
		num.push_back(atoi(str.substr(i-len,len).c_str()));
	}
	return num;
}

void output(const bignum& num)
{
	for(int i=num.size()-1;i>=0;i--)
	{
		if(i==num.size()-1)
		{
			std::cout<<num[i];
		}
		else
		{
			std::cout<<std::setfill('0')<<std::setw(9)<<std::right<<num[i];
		}
	}
	std::cout<<std::endl;
}

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

void Calc( string &str, int sum, int trans, int &move_up )
{
    if( sum > 9 )
    {
        str += sum - 10 + trans;                       // Integer to String
        move_up = 1;
    }
    else
    {
        str += sum + trans;                            // Integer to String
        move_up = 0;
    }
}

int main()
{
    int n, trans = 48;                                 //48は文字としての0を整数に変換したときの値。ex) '6' - 48 = 6
    int move_up = 0;
    string str1, str2, strr = "";

    cin >> n;

    for( int i = 0; i < n; i++ )
    {
        cin >> str1 >> str2;

        int s1 = str1.size(), s2 = str2.size();                     // while分を回す回数を決定
        int j = s1 - 1, k = s2 - 1, sum = 0;                        // sumは位ごとの合計値
        while( j >= 0 && k >= 0 )                                   // 最後の桁まで繰り上がり等計算
        {
            sum = str1[j] + str2[k] - 2 * trans + move_up;          // String to Integer
            Calc( strr, sum, trans, move_up );                      // 繰り上がりの計算
            j--;
            k--;
        }
        while( j >= 0 )                                             // 余った桁を順次格納(繰り上がり情報は保持)
        {
            sum = str1[j] - trans + move_up;
            Calc( strr, sum, trans, move_up );
            j--;
        }
        while( k >= 0 )
        {
            sum = str2[k] - trans + move_up;
            Calc( strr, sum, trans, move_up );
            k--;
        }
        if( move_up == 1 )                                          // 最後の桁での繰り上がり処理
            strr += 1 + trans;

        int sr = strr.size();
        if( sr <= 80 )
        {
            for( int i = sr - 1; i >= 0; i-- )                      // 100という文字列strは、str[0] = 1, str[1] = 0, str[2] = 0という順番で格納される。　
                cout << strr[i];
            cout << endl;
        }
        else
            cout << "overflow" << endl;

        strr = "";                                                  // strrの値をクリア
        move_up = 0;
    }
    return 0;
}

C++: #include <algorithm>
#include <cctype>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <functional>
#include <string>
#include <queue>
#include <vector>

using namespace std;

int main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    int a[128], b[128], r[128];
    fill(a, a+128, 0);
    fill(b, b+128, 0);
    fill(r, r+128, 0);
    string sa, sb;
    cin >> sa >> sb;
    reverse(sa.begin(), sa.end());
    reverse(sb.begin(), sb.end());
    for (unsigned int j = 0; j < min(128, int(sa.length())); j++)
      a[j] = sa[j] - '0';
    for (unsigned int j = 0; j < min(128, int(sb.length())); j++)
      b[j] = sb[j] - '0';
    for (int j = 0; j <= 80; j++) {
      r[j] += a[j] + b[j];
      r[j+1] += r[j] / 10;
      r[j] %= 10;
    }
    if (r[80])
      cout << "overflow" << endl;
    else {
      int k = 79;
      for (; k >= 1 && !r[k]; k--);
      for (int j = k; j >= 0; j--)
        cout << r[j];
      cout << endl;
    }
  }
  return 0;
}