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>
#define N 80

int main(void){
    char buf[N+1];
    int datas;
    int degits;
    int lint1[N+1], lint2[N+1], sum[N+1];
    int cry;
    
    scanf("%d", &datas);
    for (int n=0; n<datas; n++){
        // reset
        for (int i=0; i<N; i++) lint1[i]=lint2[i]=0;
        // input
        scanf("%s", buf);
        degits = strlen(buf);
        for (int i=0; i<degits; i++){
            lint1[degits-i-1]= buf[i]-'0';
        }
        scanf("%s", buf);
        degits = strlen(buf);
        for (int i=0; i<degits; i++){
            lint2[degits-i-1]= buf[i]-'0';
        }
        // calc
        cry=0;
        for (int i=0; i<N; i++){
            sum[i] = lint1[i]+lint2[i] + cry;
            cry = sum[i]>9 ? 1:0;
            if (cry) sum[i] -= 10;
        }
        // output
    /*    if (cry){
            puts("overflow");
        } else {
            bool zero=true;
            if (cry) puts("1");
            for (int i=N-1; i>=0; i--){
                if (zero && sum[i] != 0) zero=false;
                if (!zero) printf("%d", sum[i], i);
            }
            printf("\n");
        }
        */
    }
    
    return 0;
}

C++: #include <stdio.h>

#define DEGITS 80

void load(int a[]);
void print(int a[]);

int main(void){
    int a[DEGITS]; // a[0] = LSD
    int b[DEGITS];
    int n;
    int cry;
    
    scanf("%d", &n);
    for (int i=0; i<n; i++){
        // reset
        for (int i=0; i<DEGITS; i++){
            a[i]=b[i]=0;
        }
        // load
        load(a);
        load(b);
        // add ( a <- a + b )
        cry=0;
        for (int d=0; d<DEGITS; d++){
            a[d] += (b[d] + cry);
            cry = a[d]/10;
            if (a[d]>9){
                a[d]-=10;
            }
        }
        // print
        if (cry){
            printf("overflow\n");
        } else{
            print(a);
        }
    }

    return 0;
}

void load(int a[]){
    char *pt;
    char st[DEGITS+5];
    
    scanf("%s", st);
    for (pt=st; *pt!='\0'; pt++) ;
    for (int i=0; pt!=st; i++){
        a[i] = *(--pt)-'0';
    }
}

void print(int a[]){
    int d;
    
    for (d=DEGITS-1; d>0; d--){ 
        if (a[d] != 0) break;
    }
    for (; d>0; d--) printf("%d", a[d]);
    printf("%d\n", a[0]);
}

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

int main() {
	int n;
	cin >> n;
	for(int i = 0; i < n; i++) {
		string a, b;
		cin >> a >> b;
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());
		while(a.size() < 110) a += "0";
		while(b.size() < 110) b += "0";
		int carry = 0;
		string res = "";
		for(int i = 0; i< a.size(); i++) {
			res   += ((a[i] - '0') + (b[i] - '0') + carry) % 10 + '0';
			carry  = ((a[i] - '0') + (b[i] - '0') + carry) / 10;
		}
		while(res.size() > 1 && *(res.end()-1) == '0') res.erase(res.end()-1);
		reverse(res.begin(), res.end());
		if(res.size() > 80)
			cout << "overflow" << endl;
		else
			cout << res << 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ú»@æ­í©çÈ¢ÌÅKÉå«­
		char c[N+10] = "";

		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 < min( max(aSize, bSize), N+1); 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;
		//dlãA¦ª0ÈçNULL¶ÅÜéÌÅËÁÞ
		else if(c[0] == '\0')
			cout << '0' << endl;
		else
			cout << c << endl;
	}
	return 0;
}

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[2][80];
    for(j=0; j<2; ++j){
      for(k=0; k<80; ++k){
        digits[j][k] = 0;
      }
    }

    int overflow = 0; 

    for(j=0; j<2; ++j){
      char digit[256];
      scanf("%s%*[^\n]", digit);
      getchar();
      
      if(overflow || strlen(digit)>80){
        overflow = 1;
      }else{
        for(k=0; k<strlen(digit); ++k){
          digits[j][k] = digit[strlen(digit)-1-k]-'0';
        }
      }
    }

    if(!overflow){
      int sum[81];
      for(j=0; j<81; ++j){
        sum[j] = 0;
      }

      for(j=0; j<80; ++j){
        for(k=0; k<2; ++k){
          sum[j] += digits[k][j];
        }
        sum[j+1] += sum[j]/10;
        sum[j] %= 10;
      }

      if(sum[80]>0){
        overflow = 1;
      }else{
        int available = 0;
        for(j=80; j>=0; --j){
          if(available || sum[j]!=0 || j==0){
            available = 1;
            printf("%d", sum[j]);
          }
        }
        printf("\n");
      }
    }

    if(overflow){
      printf("overflow\n");
    }
  }

  return 0;
}