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 <sstream>
#include <deque>
class BigInt
{
  std::deque<char> m_digits;
public:
  BigInt(std::string str) {
    for(auto it = str.begin(); it != str.end(); ++it) {
      m_digits.push_back(*it - '0');
    }
  }

  BigInt(int num) {
    std::ostringstream oss;
    oss << num;
    BigInt(oss.str());
  }

  std::string str() const {
    std::string str;
    for (auto it = m_digits.begin(); it != m_digits.end(); ++it) {
      str += *it + '0';
    }
    return str;
  }

  const BigInt& operator +=(const BigInt& rhs) {
    std::deque<char> new_digits;
    auto lhs_rit = m_digits.rbegin();
    auto rhs_rit = rhs.m_digits.rbegin();

    char inc = 0;
    while (lhs_rit != m_digits.rend() &&
           rhs_rit != rhs.m_digits.rend()) {
      char temp = *lhs_rit + *rhs_rit;
      temp += inc;
      if (temp >= 10) {
        inc = temp / 10;
        temp -= inc * 10;
      }
      new_digits.push_front(temp);
      ++lhs_rit;
      ++rhs_rit;
    }

    if (lhs_rit != m_digits.rend()) {
      while (lhs_rit != m_digits.rend()) {
        char temp = *lhs_rit + inc;
        if (temp >= 10) {
          inc = temp / 10;
          temp -= inc * 10;
        }
        new_digits.push_front(temp);
        ++lhs_rit;
      }
    }
    else if (rhs_rit != rhs.m_digits.rend()) {
      while (rhs_rit != rhs.m_digits.rend()) {
        char temp = *rhs_rit + inc;
        if (temp >= 10) {
          inc = temp / 10;
          temp -= inc * 10;
        }
        new_digits.push_front(temp);
        ++rhs_rit;
      }
    }
    if (inc > 0) new_digits.push_front(inc);
    m_digits = new_digits;
  }
};

BigInt operator +(const BigInt& lhs, const BigInt& rhs)
{
  BigInt result(lhs);
  result += rhs;
  return result;
}

int main()
{
  int n;
  std::cin >> n;
  while (n--) {
    std::string num;
    std::cin >> num;
    BigInt num1(num);
    std::cin >> num;
    BigInt num2(num);
    
    BigInt num3 = num1 + num2;
    std::cout << num3.str() << std::endl;
  }
  return 0;
}

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

#define MAX_DIGIT 80


void add(char *buf1, char *buf2){
	int len1 = strlen(buf1);
	if(len1 > MAX_DIGIT){
		printf("overflow\n");
		return;
	}
	int len2 = strlen(buf2);
	if(len2 > MAX_DIGIT){
		printf("overflow\n");
		return;
	}
	
	int big1[MAX_DIGIT + 1] = {}, big2[MAX_DIGIT + 1] = {};
	
	for(int i = 0; i < len1; i++){
		big1[len1 - i - 1] = buf1[i] - 48;
	}
	for(int i = 0; i < len2; i++){
		big2[len2 - i - 1] = buf2[i] - 48;
	}
	
	int len = (len1 > len2) ? len1 : len2;
	for(int i = 0; i < len; i++){
		big1[i] += big2[i];
		if(big1[i] >= 10){
			big1[i + 1]++;
			big1[i] -= 10;
		}
	}
	
	int j = len;
	for(; j >= 0; j--){
		if(big1[j] > 0){
			break;
		}
	}
	if(j >= MAX_DIGIT){
		printf("overflow\n");
		return;
	}
	for(; j >= 0; j--){
		printf("%d", big1[j]);
	}
	printf("\n");
}

int main(){
	int n;
	
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		char buf1[101], buf2[101];
		scanf("%s", buf1);
		scanf("%s", buf2);
		add(buf1, buf2);
	}
	
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
    int n;
    for(cin>>n;n--;){
        int k=0;
        string a,b;
        cin >> a;
        cin >> b;
        if(a.size() < b.size()) swap(a,b);//????????????a>b?????????
        while(b.size() < a.size()) b = '0' + b;//????????????a==b?????????
        for(int i=a.size()-1;i>=0;i--){//???????????????????????????
            a[i] += b[i] - '0' + k;
            if(a[i] > '9'){
                a[i]-=10;
                k = 1;
            }
            else k = 0;
        }
        if(k)   a="1"+a;//??°??????????????????????????????????¶?????????¨???
        if(a.size() > 80)   cout << "overflow" << endl;
        else    cout << a << endl<<endl;
    }
    return 0;
}