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 <iostream>
#include <string>
#include <algorithm>
#include <stdlib.h>

using namespace std;

#define MAX_ORDER 80

void alignOrder(std::string& input1, std::string& input2);
int myAtoi(const char c);
void addTwoInputs(const std::string& input1, const std::string& input2, std::string& output);
bool overflowCheck(const std::string& output);

int main(void)
{
  int n;
  std::string input1, input2;
  std::string output;

  std::cin >> n;

  for (int i = 0; i < n; i++) {
    std::cin >> input1;
    std::cin >> input2;

    alignOrder(input1, input2);
    addTwoInputs(input1, input2, output);
    if (overflowCheck(output)) {
      std::cout << output << std::endl;
    }
    else {
      std::cout << "overflow" << std::endl;
    }
  }

  return 0;
}

void alignOrder(std::string& input1, std::string& input2)
{
  if (input1.size() == input2.size()) {
    return;
  }
  if (input1.size() < input2.size()) {
    std::swap(input1, input2);
  }
  int distance = input1.size() - input2.size();
  for (int i = 0; i < distance; i++) {
    input2.insert(0, "0");
  }
  return;
}

int myAtoi(const char c)
{
  return c - '0';
}

void addTwoInputs(const std::string& input1, const std::string& input2, std::string& output)
{
  int outputOrder = input1.size() + 1;
  output.resize(outputOrder);

  bool advance = false;
  for (int i = outputOrder - 2; i >= 0; i--) {
    int num1 = myAtoi(input1[i]);
    int num2 = myAtoi(input2[i]);
    int sum = num1 + num2;
    if (advance) {
      sum++;
    }
    char sumStr[10];
    itoa(sum, sumStr, 10);
    if (sumStr[1] == '\0') {
      output[i + 1] = sumStr[0];
      advance = false;
    }
    else {
      output[i + 1] = sumStr[1];
      advance = true;
    }
    if (i == 0) {
      if (advance) {
        output[0] = '1';
      }
      else {
        output = output.substr(1);
      }
    }
  }
}

bool overflowCheck(const std::string& output)
{
  if (output.size() > MAX_ORDER) {
    return false;
  }
  return true;
}

C++: #include <stdio.h>
#include <string.h>


#define DIGIT (5)

int main()
{
	int i, j, n, temp;
	char num[2][DIGIT + 1];
	char ans[DIGIT + 2];
	char fmt[8];
	int len[2], index;
	
	// scanf format
	sprintf(fmt, "%%%ds", DIGIT);
	
	scanf("%d", &n);
	
	for (i = 0; i < n; ++i) {
		for (j = 0; j < 2; ++j) {
			scanf(fmt, num[j]);
			while (getchar() != '\n');
			
			len[j] = strlen(num[j]);
		}
		
		// bigger one
		index = (len[0] < len[1]) ? 1 : 0;
		
		ans[len[index] + 1] = '\0';
		
		temp = 0;
		for (j = 1; j <= len[index ^ 1]; ++j) {
			temp += (num[0][len[0] - j] - '0') + (num[1][len[1] - j] - '0');
			ans[len[index] - j + 1] = temp % 10 + '0';
			temp /= 10;
		}
		for (; j <= len[index]; ++j) {
			temp += (num[index][len[index] - j] - '0');
			ans[len[index] - j + 1] = temp % 10 + '0';
			temp /= 10;
		}
		
		if (temp) {
			if (len[index] == DIGIT) {
				puts("overflow");
			} else {
				ans[0] = '1';
				puts(ans);
			}
		} else {
			puts(ans + 1);
		}
	}
	
	return 0;
}

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

int main(){
  std::string as;
  std::string bs;
  int a[102]={0};
  int b[102]={0};
  int sum[102]={0};
  int a_size,b_size,sum_size,n,i,j,flag=0;
  char num;

  std::cin >> n;

  for(i=0;i<n;i++){
    std::cin >> as >> bs;
    a_size = as.size();
    b_size = bs.size();

    for(j=0;j<102;j++){   //??????????????????(100??????00100)
      if(101-j<=a_size){
        a[101-j] = as[j-a_size] - '0';
      }else{
        a[101-j] = 0;
      }
      if(101-j<=b_size){
        b[101-j] = bs[j-a_size] - '0';
      }else{
        b[101-j] = 0;
      }
    }

    for(j=0;j<102;j++){       //sum????¨????
      sum[j] = a[j] + b[j];
      if(flag){               //??°?????????
        sum[j] += 1;
        flag = 0;
      }
      if(j>=80&&sum[j]!=0){   //???????????????????????????
        overflow = 1;
        break;
      }
      if(sum[j] > 9){         //??°???????????????
        sum[j] -= 10;
        flag = 1;
      }
    }
    if(overflow){             //??????
      std::cout << "overflow" << std::endl;
      overflow = 0;
      continue;
    }
    for(j=0;j<102;j++){
      if(sum[101-j]!=0){
        sum_size = 101-j;
        break;
      }
    }
    for(j=sum_size;j>=0;j--){
      num = sum[j] + '0';
      std::cout << num;
    }
    std::cout << std::endl;
  }
}