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

using namespace std;

int main(int argc, char* argv[])
{
	int i;
	int num, pos;
	int len1, len2;
	int sum[101] = { 0 };
	char temp;
	char f1[101] = { 0 }, f2[101] = { 0 };	

	cin >> num;
	while (num--) {
		cin >> f1;
		cin >> f2;

		len1 = strlen(f1);
		len2 = strlen(f2);
		if (len1 > 80 || len2 > 80) {
			cout << "overflow" << endl;
			continue;
		}

		for (int i = 0; i < len1 / 2; i++) {
			temp = f1[i];
			f1[i] = f1[len1 - 1 - i];
			f1[len1 - 1 - i] = temp;
		}
		for (int i = 0; i < len2 / 2; i++) {
			temp = f2[i];
			f2[i] = f2[len2 - 1 - i];
			f2[len2 - 1 - i] = temp;
		}

		for (i = 0; i < len1; i++) f1[i] = f1[i] - 0x30;
		for (i = 0; i < len2; i++) f2[i] = f2[i] - 0x30;

		for (int i = 0; i < 100; i++) {
			sum[i] += (f1[i] + f2[i]);
			if (sum[i] >= 10) {
				sum[i] -= 10;
				sum[i + 1]++;
			}
		}

		for (pos = 100; sum[pos] == 0; pos--) {}
		if (pos >= 80) {
			cout << "overflow" << endl;
			return 0;
		}
		for (int i = pos; i >= 0; i--) {
			cout << sum[i];
		}
		cout << endl;
	}
}

C++: #include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
using namespace std;
int main(void)
{
	int y;
	scanf("%d",&y);
	for(int z = 0;z < y;z++)
	{
		char suji1[1000000],suji2[1000000];
		char ans[1000000] = {0};

		for(int i = 0;i<82;i++)
		{
			suji1[i] = '0';
			suji2[i] ='0';
		}

		int overflow = 0;

		scanf("%s",suji1);
		scanf("%s",suji2);
		int suji1s = strlen(suji1);
		int suji2s = strlen(suji2);

		int anss;
		if(suji1s>suji2s)  anss = suji1s;
		else anss = suji2s;

		suji1[suji1s] = '0';
		suji2[suji2s] = '0';

		reverse(suji1,suji1+suji1s);
		reverse(suji2,suji2+suji2s);

		for(int i = 0;i < 80;i++)
		{
			ans[i] = suji1[i]+suji2[i] - '0';
			if(ans[i] >= ':')
			{
				ans[i]  = ans[i] - 10;
				suji2[i+1] = suji2[i+1]+1;
			}
		}
		
		if(ans[anss]!= '0') anss++;
		if(anss >=81) overflow = 1;
		reverse(ans,ans+anss);
		ans[anss] = 0;
		if(overflow >= 1)
		{
			printf("overflow\n");
		}
		else
		{
			printf("%s\n",ans);
		}
		
	}
	return 0;
}