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*****/
#include <iostream>
#include <fstream>

/*****デバッグ定義*****/
//#define DEBUG
/*****マクロ定義*****/

/*****名前空間*****/
using namespace std;

/*****グローバル変数置き場*****/

/*****その他関数置き場*****/

/*****main関数*****/
int main(){
	/*****ファイルオープン*****/
#ifdef DEBUG
	ofstream fout("output.txt");
	ifstream fin("input.txt");
	if(!fout || !fin){
		cout << "Can't open the file.\n";
		return;
	}
#endif
	/*****変数置き場*****/
	char number1[81];
	char number2[81];
	int sum[81];
	int digit1;
	int digit2;
	int digit_sum;
	int move_up;
	int i,j;
	int n;
	/*****処理部*****/
	cin >> n;
	for(int loop=0;loop<n;loop++){
		for(int a=0;a<81;a++){
			number1[a] = '0';
			number2[a] = '0';
		}
		digit1 = 0;
		digit2 = 0;
		cin >> number1;
		cin >> number2;
		while(number1[digit1] != '\0')	digit1++;
		while(number2[digit2] != '\0')	digit2++;
		move_up = 0;
		//cout << digit1 << " " << digit2 << endl;
		if(digit1 != digit2){
			if(digit1 > digit2){
				i = digit1;
				j = digit2;
				while(j>=0){
					number2[i] = number2[j];
					number2[j] = '0';
					i--;j--;
				}
			}else{
				i = digit1;
				j = digit2;
				while(i>=0){
					number1[j] = number1[i];
					number1[i] = '0';
					i--;j--;
				}
			}
		}
		/*for(int i=((digit1 > digit2)? digit1 : digit2);i>0;i--){
			cout << number1[i-1];
		}
		cout << endl;
		for(int i=((digit1 > digit2)? digit1 : digit2);i>0;i--){
			cout << number2[i-1];
		}
		cout << endl;*/
		//for(int i=0;i<4;i++)	cout << number2[i] << " " << atoi(&number2[i]) << endl;
		//for(int i=0;i<4;i++)	cout << number1[i] << " " << atoi(&number1[i]) << endl;
		digit_sum = 0;
			for(int i=((digit1 > digit2)? digit1 : digit2);i>0;i--){
		//cout << atoi(&number1[i-1]) << " " << atoi(&number2[i-1]) << endl;
			sum[digit_sum]
				= number1[i-1] - '0'
					+ number2[i-1] - '0'
			+ move_up;
			if(sum[digit_sum] >= 10){
				move_up = 1;
				sum[digit_sum] = sum[digit_sum] % 10;
			}else{
				move_up = 0;
			}
			digit_sum++;
		}
		if(move_up == 1){
			sum[digit_sum] = move_up;
			digit_sum++;
		}
		//cout << digit_sum << endl;
		if(digit_sum > 80)	cout << "overflow" << endl;
		else{
			for(int k=digit_sum-1;k>=0;k--){
				cout << sum[k];
			}
			cout << endl;
		}
	}
	/*****処理終了後*****/
#ifdef DEBUG
	fout.close();
	fin.close();
#endif
	return 0;
}

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

#define DIGIT  ( 80 )

using namespace std;

static
int N;

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  cin >> N;

  while ( N-- )
  {
    string        A, B;
    int           C[ DIGIT + 1 ] = { 0 };
    const char  * p;

    cin >> A >> B;

    p = A.c_str ( );
    for ( size_t i = 0; i < A.length ( ); ++i )
    {
      C[ i ] = p[ A.length ( ) - i - 1 ] - '0';
    }

    p = B.c_str ( );
    for ( size_t i = 0; i < B.length ( ); ++i )
    {
      C[ i ]     += p[ B.length ( ) - i - 1 ] - '0';
    }

    for ( size_t i = 0; i < DIGIT; ++i )
    {
      C[ i + 1 ] += C[ i ] / 10;
      C[ i ]     %= 10;
    }

    if ( C[ DIGIT ] )
    {
      cout << "overflow";
    }
    else
    {
      int i = DIGIT;
      while ( !C[ i ] && i > 0 )
        --i;
      while ( i >= 0 )
      {
        cout << C[ i-- ];
      }
    }
    cout << endl;
  }

  return ( 0 );
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int n;
int main()
{
	cin>>n;
	for(;n--;)
	{
		string s,t,u="";cin>>s>>t;
		if(s.size()<t.size())swap(s,t);
		int a=0;
		for(int i=0;i<s.size();i++)
		{
			a+=s[s.size()-i-1]-48;
			if(i<t.size())a+=t[t.size()-i-1]-48;
			u+=a%10+48;
			a/=10;
		}
		if(a)u+=a+48;
		if(u.size()>80)
		{
			cout<<"overflow"<<endl;
		}
		else
		{
			for(int i=u.size();i--;)cout<<u[i];
			cout<<endl;
		}
	}
}

C++: //0015 National Budget
//80ÜÅÌ2ÂÌ®Ì«µZÊðoÍ¹æ
//1sÚÉf[^Zbgnª^¦çêé
//^¦çê½â»Ìaª80ð´¦½êAoverflowÆoÍµÄ­¾³¢

#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;


int main(void)
{
	int n;
	cin >> n;
	while(n--)
	{
		const int N = 80;
		int i;
		string a, b;
		//0ú»
		char c[N+2] = "";

		cin >> a >> b;

		//vZµâ·¢æ¤É½]
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());

		int aSize, bSize;
		aSize = a.size();
		bSize = b.size();

		//Ü¸ÍAcÉ»ÌÜÜlðüêÄ¢­
		for(int i = 0; i < max( max(aSize, bSize), N); i++)
		{
			int s = 0;
			if(i < aSize)
				s += a[i] - '0';
			if(i < bSize)
				s += b[i] - '0';

			c[i] += s;
			c[i+1] += c[i]/10;
			c[i] %= 10;
		}

		//ã©ç©Ä¢ÁÄA0ÈOÌ¶ª»ê½ç¶»·é
		bool isAnswer = false;
		for(i = sizeof(c)-1; i >= 0; i--)
		{
			if(c[i])
				isAnswer = true;
			if(isAnswer)
				c[i] += '0';
		}
		//½]µÄ®¬
		reverse(c, c+strlen(c));

		//àµà80¶ÚªNULL¶Å êÎI[o[t[
		if(c[N])
			cout << "overflow" << endl;
		else
			cout << c << endl;
	}
	return 0;
}