Go: package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	const maxCapacity = 512 * 1024
	buf := make([]byte, maxCapacity)
	scanner.Buffer(buf, maxCapacity)

	n := nextInt()
	maxint, _ := new(big.Int).SetString("100000000000000000000000000000000000000000000000000000000000000000000000000000000", 10)

	for i := 0; i < n; i++ {
		aStr := nextString()
		bStr := nextString()

		a, _ := new(big.Int).SetString(aStr, 10)
		b, _ := new(big.Int).SetString(bStr, 10)
		c := big.NewInt(0).Add(a, b)

		if c.Cmp(maxint) < 0 {
			fmt.Println(c)
		} else {
			fmt.Println("overflow")
		}
	}
}

C++: #include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void)
{
    char num1[81],num2[81];
        int a1[81],a2[81],ans[81];
        int i,j,n,k,l1,l2,kuriagari=0;
        scanf("%d",&n);
        for(i=0;i<n;i++)
        {
                for(j=0;j<81;j++)
                {
                        a1[j] = 0;
                        a2[j] = 0;
                        ans[j] = 0;
                }
                scanf("%s",num1);
                scanf("%s",num2);
                l1 = strlen(num1);
                l2 = strlen(num2);
                for(j=0;j<l1;j++)
                {
                        a1[j] = num1[l1-1-j] - '0';
                }
                for(j=0;j<l2;j++)
                {
                        a2[j] = num2[l2-1-j] - '0';
                }
                for(j=0;j<81;j++)
                {
                        ans[j] = (a1[j] + a2[j] + kuriagari) % 10;
                        kuriagari = (a1[j] + a2[j] + kuriagari)/10;
                }
                if(ans[80] != 0)
                {
                        printf("overflow\n");
                }
                else
                {
                        for(j=80;j>=0;j--)
                        {
                                if(ans[j] != 0)
                                {
                                        k = j;
                                        break;
                                }
                        }
                        for(j=k;j>=0;j--)
                        {
                                printf("%d",ans[j]);
                        }
                        printf("\n");
                }
        }
        return 0;
}

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

int main(){


  string strx,stry;
  int N;
  cin >> N;
  while(N){

    cin >> strx ;
    cin >> stry;
    int x[30] = {0},y[30] = {0};
    int i,lenx = strx.size(), leny = stry.size();
    string tmp;
    
    for( i = 0; lenx > 5 ; i++){
      tmp = strx.substr(lenx - 5);
      x[i] = atoi(tmp.c_str());
      strx =  strx.substr(0,lenx - 5);
      lenx -= 5;
    }
    x[i] = atoi(strx.c_str());
    for( i = 0; leny > 5 ; i++){
      tmp = stry.substr(leny - 5);
      y[i] = atoi(tmp.c_str());
      stry =  stry.substr(0,leny - 5);
      leny -= 5;
    }
    y[i] = atoi(stry.c_str());
    
    
    int ans[20] = {0};
    for(i = 0 ; i < 20 ; i++){
      ans[i] += x[i] + y[i];
      if(ans[i] > 99999){
	ans[i+1] += 1;
	ans[i] -= 100000;
      }
    }
    if(ans[16] != 0)
      cout << "overflow"<< endl;
    else{
      for(i = 15; i >= 0 ; i--){
	if(ans[i] != 0)
	  break;
      }
      cout << ans[i];
      for(i = i-1; i >= 0 ; i--){
	if(ans[i] < 10) cout << "0";
	if(ans[i] < 100) cout << "0";
	if(ans[i] < 1000) cout << "0";
	if(ans[i] < 10000) cout << "0";
	cout << ans[i];
      }
      cout << endl;
    }
    N--;
  }
  return 0;
}

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

int main()
{
	int n;
	cin >> n;

	for(int i=0;i<n;++i){
		string N1,N2;
		vector<int> num_line;
		cin >> N1 >> N2;

		int upper=0;
		int num;
		string longer  = N1.size() > N2.size() ? N1 : N2;
		string shorter = N1.size() < N2.size() ? N1 : N2;

		for(int i=0;i<longer.size();++i){
			if(i < shorter.size())
				num = longer[i]-'0' + shorter[i]-'0' + upper;
			else
				num = longer[i] - '0' + upper;
			
			if(num > 9){
				upper = 1;
				if(i != longer.size() -1)
					num -= 10;
			}else{
				upper = 0;
			}

			num_line.push_back(num);
		}

		if(num_line.size() > 80)
			cout << "overflow" << endl;
		else
			for(int i = num_line.size()-1;i>=0;--i)
				cout << num_line[i] ;

	}
	return 0;
}

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

int main()
{
    int N,j;
    cin >> N;
    for(int i=0 ; i<N ; i++){
        int ans[81]={0};
        ans[0]=11111;
        char strA[100],strB[100];
        cin >> strA >> strB;
        if(strlen(strA)>80||strlen(strB)>80){
            cout << "overflow" << endl;
            break;
        }
        char str1[strlen(strA)][2],str2[strlen(strB)][2];
        for(int i=0 ; i<strlen(strA) ; i++){
            str1[i][0]=strA[i];
            str1[i][1]='\0';
        }
        for(int i=0 ; i<strlen(strB) ; i++){
            str2[i][0]=strB[i];
            str2[i][1]='\0';
        }
        int a[81]={0},b[81]={0};
        a[0]=11111;
        b[0]=11111;
        j=strlen(strA)-1;
        for(int i=80 ; j>=0 ; i--){
            a[i]=atoi(str1[j]);
            j--;
        }
        j=strlen(strB)-1;
        for(int i=80 ; j>=0 ; i--){
            b[i]=atoi(str2[j]);
            j--;
        }
        for(int i=80 ; i!=0 ; i--){
            ans[i]=ans[i]+a[i]+b[i];
            if(ans[i]>=10){
                ans[i]=ans[i]-10;
                ans[i-1]++;
            }
        }
        if(ans[0]!=11111){
            cout << "overflow" << endl;
            break;
        }
        for(int i=1 ; i<81 ; i++){
            if(ans[i]!=0){
                j=i;
                break;
            }
        }
        for(int i=j ; i<81 ; i++){
         cout << ans[i];
        }
        cout << '\n';
    }
    return 0;
}