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>

int main(void)
{
	char str[2][1000];
	int b, s;
	int len[2];
	int i, j;
	int n;
	int flag;
	
	scanf("%d", &n);
	
	while (n){
		for (i = 0; i < 1000; i++){
			str[0][i] = str[1][i] = 0;
		}
		s = 1;
		b = 0;
		for (i = 0; i < 2; i++){
			scanf("%s", str[i]);
			len[i] = strlen(str[i]);
		}
		
		
		else {
			if (len[0] > 80 || len[1] > 80){
				printf("overflow\n");
				break;
			}
			if (len[0] < len[1]){
				s = 0;
				b = 1;
			}
			
			for (i = len[b], j = len[s]; i >= 0; i--, j--){
				if (j >= 0){
					str[s][i] = str[s][j];
				}
				else {
					str[s][i] = '0';
				}
			}
			
			flag = 0;
			i = len[b];
			while (i >= 0){
				if (str[s][i] + str[b][i] - '0' + flag > '9'){
					flag = 1;
				}
				else {
					flag = 0;
				}
				i--;
			}
			
			if (flag){
				for (i = len[b]; i >= 0; i--){
					for (j = 0; j < 2; j++){
						str[j][i + 1] = str[j][i];
					}
				}
				str[0][0] = '0';
				str[1][0] = '0';
			}
			
			for (i = len[b]; j >= 0; i--){
				str[b][i] += (str[s][i] - '0');
				if (str[b][i] > '9'){
					str[b][i] -= 10;
					str[b][i - 1]++;
				}
			}
			str[b][len[b] + flag] = '\0';
			
			printf("%s\n", str[b]);
		}
		
		n--;
	}
	
	return (0);
}

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

using namespace std ;

class Bigint {
	vector<int> digit ;//一桁ずつ格納する
	
public:
	Bigint(){}
	Bigint(string) ;
	Bigint operator + (Bigint &) ;
	friend ostream& operator << (ostream& os, const Bigint& obj) ;
};

Bigint::Bigint(string str)
{
	for(string::iterator it = str.begin() ;
		it != str.end() ;
		it++){
		this->digit.push_back(*it - '0');//一桁ごとに切り分ける
	}
}
Bigint Bigint::operator + (Bigint &obj)
{
	Bigint *domina ;//dominant
	Bigint *depend ;//dependent
	
	if(this->digit.size() >= obj.digit.size()){
		domina = this ;//大きい方が支配的である
		depend = &obj ;
	}else{
		domina = &obj ;
		depend = this ;
	}
	
	int diff = domina->digit.size() - depend->digit.size() ;
	for(int i=0 ; i < diff ; i++){//zero fill (zero padding)
		depend->digit.insert(depend->digit.begin(),0) ;// .unshift(0)　前から詰めるのがunshiftである。しかし、c++は融通も気も効かないので、perlなどで見られるunshiftなる命令があるわけが無く、わざわざ面倒な長い書き方をして、unshiftの代理とせねばならない。しかも、c++11でも無い限りは、back()もfront()も使えない。通常のc++では様々な語が使えないので、ストレスは極限まで上昇する。vectorとstringでこれらの便利極まりない用語が使えないので、c++での文字列操作はperlよりも数段階も悪化した劣悪な環境に置かれている。splitすらも無いというギリギリの状況で、プログラマは一体何をすればいいのか。全く以て深い霧に覆われている。
	}
	
	Bigint temp ;
	int carry = 0 ;
	for(vector<int>::reverse_iterator it = domina->digit.rbegin(),
		jt = depend->digit.rbegin() ;
		it != domina->digit.rend() ;
		it++, jt++){// reverseであることに注意
		int sum = *it + *jt + carry ;
		if(sum >= 10){
			carry = sum/10 ;
			sum = sum%10 ;
		}else{
			carry = 0 ;
		}
		temp.digit.insert(temp.digit.begin(),sum) ;// unshift
	}
	if(carry > 0){
		temp.digit.insert(temp.digit.begin(),carry) ;// unshift
	}
	
	return temp ;
}
ostream& operator << (ostream& os, const Bigint& obj)
{
	if(obj.digit.size() > 80){
		os << "overflow" ;
		return os ;
	}
	
	for(typeof(obj.digit.begin()) it = obj.digit.begin() ;
		it != obj.digit.end() ;
		it++){
		os << *it ;
	}
	
	return os ;
}
int main(void)
{
	int N;
	string str_a, str_b;
	
	cin >> N;
	
	for (int i = 0; i < N; i++){
		cin >> str_a >> str_b ;
		Bigint a(str_a), b(str_b);
		cout << a+b << endl ;
	}
}

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

int strlen(char * str, int len) {
	int i=0;
	while(1) {
		if (str[i]=='\0') {
			return i;
		}
		if (len==i) break;
		i++;
	}
	return len;
}

int main() {
	char *a,*b,*c;
	int n,len ,lena ,lenb , i, j, p, q, r1, r2, or1;
	scanf("%d",&n);
	// the definition of a , b , c
	a = (char *)malloc( 81 * n);
	b = (char *)malloc( 81 * n);
	c = (char *)malloc( 82 * n +2);
	for(i=0;i<n;i++) {
		scanf("%s",&a[i*81]);
		scanf("%s",&b[i*81]);
	}
	for(j=0;j<n;j++) {
		lena = strlen((char *)(&a[0] + j*81),81)-1;
		lenb = strlen((char *)(&b[0] + j*81),81)-1;
		if ( lena>lenb ) len = lena;
		else len = lenb;
		
		c[j*82+len+1]='\0';
		or1 = 0;
		r1 = r2 = 0;
		for(i=0;i<=len;i++) {
			// '0' is 48.

			if ((lena-i)>=0) p = a[j*81+lena-i] - '0';
			else p = 0;

			if ((lenb-i)>=0) q = b[j*81+lenb-i] - '0';
			else q = 0;

			or1 = r1;
			// Quotient
			if ((p+q+or1)>=10) r1 = 1;
			else r1 = 0;

			r2 = (p+q+or1)%10; // Remainder
			c[j*82+len-i] = '0' + r2;
		}
		if (r1>0) {
			c[j*82+len+2]='\0';
			for(i=0;i<=len;i++) {
				c[j*82+len+1-i] = c[j*82+len-i];
			}
			c[j*82] = r1 + '0';
			len++;
		}
		if (len>80){
			printf("Overflow\n");
		}else {
			printf("%s\n",&c[j*82]);
		}
	}
	free(a);
	free(b);
	free(c);
	exit(0);
}

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

int main() {
	int n,x1,x2,y1,y2,p,q,a=0,b=0;
	vector<int> E,F;
	vector<long long int> S, T;
	vector<vector<long long int>> I,J;
	string s, t;
	vector<string> U;
	vector<vector<string>> UU;

	cin >> n;
	for (int k = 0; k < n; k++) {
		cin >> s >> t;
		int f = 0;
		if (s.size() > 80 || t.size() > 80) {
			f = 1;
			F.push_back(f);
		}
		else F.push_back(0);
		x1 = s.size() % 10; y1 = (s.size()+9) / 10;p = 8 - y1;
		for (int i = 0; i < p; i++)S.push_back(0);
		if (x1 == 0) for (int i = 0; i < y1; i++)S.push_back(stoll(s.substr(i * 10, 10)));
		else {
			S.push_back(stoll(s.substr(0, x1)));
			for (int i = 1; i < y1; i++)S.push_back(stoll(s.substr(x1 + (i-1) * 10, 10)));
		}

		x2 = t.size() % 10; y2 = (t.size()+9) / 10;q = 8 - y2;
		for (int i = 0; i < q; i++)T.push_back(0);
		if (x2 == 0) for (int i = 0; i < y2; i++)T.push_back(stoll(t.substr(i * 10, 10)));
		else {
			T.push_back(stoll(t.substr(0, x2)));
			for (int i = 1; i < y2; i++)T.push_back(stoll(t.substr(x2 + (i-1) * 10, 10)));
		}
		I.push_back(S); S.clear();
		J.push_back(T); T.clear();
	}
	for (int k = 0; k < I.size(); k++) {
		for (int i = 0; i < 8; i++) U.push_back(to_string(I[k][i] + J[k][i]));
		UU.push_back(U); U.clear();
	}
	
	for (int k = 0; k < I.size(); k++) {
		for (int i = 7; i >= 0; i--) {
			UU[k][i] = to_string(stoll(UU[k][i]) + b);
			if (UU[k][i].size() == 11 && i == 0) {
				UU[k][i] = "a";
				b = 1;
			}
			else if (UU[k][i].size() == 11) {
				UU[k][i] = UU[k][i].substr(1, 10);
				b = 1;
			}
			else if (UU[k][i].size() < 10) {
				for (int j = 0; j < 10 - UU[k][i].size()+j; j++) UU[k][i] = "0" + UU[k][i];
				b = 0;
			}
			else b = 0;
		}
		b = 0;
	}

	for (int k = 0; k < UU.size(); k++) {
		int e = 0;
		for (int i = 0; i < UU[k].size(); i++) {
			if (UU[k][i] == "a") {
				e = 100;
				E.push_back(e);
				break;
			}
			else if (stoll(UU[k][i]) == 0);
			else {
				e = i;
				E.push_back(e);
				break;
			}
		}
	}

		for(int k=0;k<UU.size();k++){
			if (E[k] == 100)cout << "overflow" << endl;
			else if (F[k] == 1)cout << "overflow" << endl;
			else {
				cout << stoll(UU[k][E[k]]);
				for (int i = E[k]+1; i < UU[k].size(); i++) cout << UU[k][i];
			}
			cout << endl;
		}
	return 0;
}