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 <stdio.h>

int main(void) {

  int n;

  char buf[100];
  char c;

  int a[100],b[100];
  int result[100];
  
  int sum,carry;
  int idx1,idx2;
  int maxlen;

  int i,j;

  scanf("%d",&n);

  c=getchar();

  for(i=0;i<n;i++) {

    fgets(buf,sizeof(buf),stdin);

    idx1=0;

    while(buf[idx1]!='\n') {

      a[idx1]=buf[idx1]-48;

      idx1++;

    }

    //for(j=0;j<idx1;j++) printf("%d",a[j]);

    fgets(buf,sizeof(buf),stdin);

    idx2=0;

    while(buf[idx2]!='\n') {

      b[idx2]=buf[idx2]-48;

      idx2++;

    }

    if(idx1>idx2) maxlen=idx1;
    
    else maxlen=idx2;

    carry=0;

    for(j=0;j<maxlen;j++) {

      if(j<idx1 && j<idx2) sum=a[idx1-j-1]+b[idx2-j-1]+carry;

      else if(j>=idx1) sum=b[idx2-j-1]+carry;

      else sum=a[idx1-j-1]+carry;


      if(sum>=10) carry=1;

      else carry=0;

      result[j]=sum%10;

    }
    //printf("%d\n",carry);
    if(carry==1) {

      if(maxlen>=80) printf("overflow\n");

      else {

	printf("1");

	for(j=maxlen-1;j>=0;j--) {

	  printf("%d",result[j]);

	}

	putchar('\0');

	puts("");

      }

    }

    else {

      for(j=maxlen-1;j>=0;j--) {

	printf("%d",result[j]);

      }

      puts("");

    }

  }

  return 0;

}

C++: #include <cstdio>
#include <cstring>
#define	BCD_SIZE	96

int checkOverFlow(char *numStr) {
	return strlen(numStr) > 80;
}

template <typename T> void mySwap(T &a, T &b) {
	T t = a; a = b; b = t;
}

template <typename T> void reverseArray(T a[], int n) {
	for (int i = n / 2 - 1; i >= 0; --i) { mySwap(a[i], a[n - i - 1]); }
}

void str2bcd(char *str, int n) {
	int len = (int)strlen(str), i;
	reverseArray(str, len);
	for (i = 0; i < len; ++i) { str[i] &= 0xf; }
	for (; i < n; ++i) { str[i] = 0; }
}

void bcd2str(char *bcd, int n) {
	int len;
	for (int i = n - 1; i >= 0 && bcd[i] == 0; --i) { len = i; }
	if (len <= 0) { len = 1; }
	reverseArray(bcd, len);
	for (int i = 0; i < len; ++i) { bcd[i] |= 0x30; }
}

void calcLargeIntSum(char sumStr[], char numStr[][BCD_SIZE], int numNum) {
	char carry = 0;
	for (int i = 0; i < numNum; ++i) { str2bcd(numStr[i], BCD_SIZE); }
	for (int i = 0; i < BCD_SIZE; ++i) {
		sumStr[i] = carry;
		for (int j = 0; j < numNum; ++j) { sumStr[i] += numStr[j][i]; }
		carry = sumStr[i] / 10;
		sumStr[i] %= 10;
	}
	bcd2str(sumStr, BCD_SIZE);
	for (int i = 0; i < numNum; ++i) { bcd2str(numStr[i], BCD_SIZE); }
}

int main() {
	char numStr[2][BCD_SIZE], sumStr[BCD_SIZE];
	int dataSet;
	for (scanf("%d", &dataSet); dataSet > 0; --dataSet) {
		scanf("%82s\n%82s", numStr[0], numStr[1]);
		if (checkOverFlow(numStr[0]) || checkOverFlow(numStr[1])) {
			puts("overflow");
			continue;
		}
		calcLargeIntSum(sumStr, numStr, 2);
		if (checkOverFlow(sumStr)) {
			puts("overflow");
			continue;
		}
		printf("%s\n", sumStr);
	}
	return 0;
}

C++: #include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

void arrangeDigits(string &str1, string &str2){

  reverse(str1.begin(), str1.end());
  reverse(str2.begin(), str2.end());
  
  while(str1.size() < str2.size()){
    str1 += '0';
  }
  while(str2.size() < str1.size()){
    str2 += '0';

  // cout << "str1: " << str1 << endl;
  // cout << "str2: " << str2 << endl;
  }
}

int main(){
  int numDatasets;
  cin >> numDatasets;
  
  for(int i=0;i<numDatasets;i++){
    bool flag = false;
    string str1, str2;

    cin >> str1;
    //80????¶?????????´???
    if(str1.length() > 80){
      flag = true;
    }

    cin >> str2;
    //80????¶?????????´???
    if(str2.length() > 80){
      flag = true;
    }

    // ??????????????????
    arrangeDigits(str1, str2);
      
    //?¨????

    int c = 0;
    string res;

    // cout << str1.length() << endl;
    
    for(int i=0;i<str1.size();i++){
      int now = c + str1[i] - '0' + str2[i] -'0';
      res += now%10 + '0';
      c = now/10;
    }

    if(c){
      res += c+'0';
    }

    if(res.size()>80){
      flag == true;
    }

    reverse(res.begin(), res.end());
    
    if(flag == false){
      cout << res << endl;
    }else{
      cout << "overflow" << endl;
    }
    
  }
}