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 <cstdio>
#include <cstring>
#define MAX_NUM 100

using namespace std;

void array_add(int *a,int *b){
	int i;
	for(i = MAX_NUM - 1;i > 0;i--){
		a[i] = a[i] + b[i];
		a[i - 1] = a[i - 1] + a[i] / 10;
		a[i] %= 10;
	}
}

int main(void){
	int n, i, j, len1,len2, val1[MAX_NUM], val2[MAX_NUM];
	char c;
	scanf("%d%*c",&n);
	for(i = 0;i < n;i++){
		for(j = 0;(c = getchar()) != '\n';j++){
			val1[j] = c - '0';
		}
		len1 = j;
		for(j = 0;(c = getchar()) != '\n';j++){
			val2[j] = c - '0';
		}
		len2 = j;
		for(j = MAX_NUM - 1;j > MAX_NUM - 1 - len1;j--){
			val1[j] = val1[len1 - 1 + (j - (MAX_NUM - 1))];
		}
		for(;j >= 0;j--){
			val1[j] = 0;
		}
		val1[MAX_NUM] = 0;
		for(j = MAX_NUM - 1;j > MAX_NUM - 1 - len2;j--){
			val2[j] = val2[len2 - 1 + (j - (MAX_NUM - 1))];
		}
		for(;j >= 0;j--){
			val2[j] = 0;
		}
		array_add(val1,val2);
		for(j = 0;val1[j] == 0 && j < MAX_NUM;j++);
		if(j <= MAX_NUM - 81)
			printf("overflow");
		else if(j == MAX_NUM)
			printf("0");
		else{
		for(;j < MAX_NUM;j++){
			printf("%d",val1[j]);
		}
		}
		printf("\n");
	}
	return 0;
}

C++: #include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>

const int MAX_INPUT = 1000000;
const int ARRAY_SIZE = 20;
const int MAX_LEN = 8;
char inputA[MAX_INPUT];
char inputB[MAX_INPUT];

void toBigInt(char *str, long *r) {
    int len = strlen(str);
    int endIndex = ARRAY_SIZE - (len / MAX_LEN) - 1;

    {
        int offset = 0;
        for (int i = 0; i < ARRAY_SIZE; ++i) {
            char temp[MAX_LEN + 1] = { 0 };
            int readLen = ((len - offset) < MAX_LEN) ? len - offset : MAX_LEN;
            char* start = str + len - offset - readLen;

            strncpy(temp, start, readLen);
            r[ARRAY_SIZE - i- 1] = (long)atoi(temp);
            offset += readLen;
        }
    }
}

int main() {
    const char OVER[] = "overflow\n";
    int n = 0;
    scanf("%d", &n);

    for (int i = 0; i < n; ++i) {
        scanf("%s", &inputA);
        scanf("%s", &inputB);
        long a[ARRAY_SIZE] = { 0 };
        long b[ARRAY_SIZE] = { 0 };
        long r[12] = { 0 };
        int lenA = 0;
        int lenB = 0;
        const int MAX_INPUT_LEN = 80;
        lenA = strlen(&inputA[0]);
        lenB = strlen(&inputB[0]);
        if ((MAX_INPUT_LEN < lenA) || (MAX_INPUT_LEN < lenB)) {
            printf(OVER);
            continue;
        }

        toBigInt(inputA, a);
        toBigInt(inputB, b);
        for (int i = 0; i < ARRAY_SIZE; ++i) {
            int curRIndex = 12 - i - 1;
            r[curRIndex] += a[ARRAY_SIZE - i - 1] + b[ARRAY_SIZE - i - 1];
            const int MAX = 99999999;
            if (MAX < r[curRIndex]) {
                r[curRIndex - 1] = r[curRIndex] / (MAX + 1);
                r[curRIndex] %= (MAX + 1);
            }
        }

        if ((9999999 < r[2]) || (0 < r[1]) || (0 < r[0])) {
            printf(OVER);
            continue;
        }

        {
            bool started = false;
            bool noOutput = true;
            for (int i = 0; i < 12; ++i) {
                if (!started && (0 < r[i])) {
                    started = true;
                    printf("%d", r[i]);
                    noOutput = false;
                    continue;
                }

                if (started) {
                    long temp = (r[i] == 0) ? 1 : r[i];
                    bool didFor = false;
                    for (int j = 0; temp * pow(10, j) < 1000000; ++j) {
                        printf("0");
                        didFor = true;
                    }
                    if (didFor) {
                        printf("0");
                    }
                    printf("%d", r[i]);
                }
            }

            if (noOutput) {
                printf("0");
            }
        }
        printf("\n");
        for (int i = 0; i < MAX_INPUT; ++i) {
            inputA[i] = 0;
            inputB[i] = 0;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <typeinfo>
#include <sstream>
using namespace std;
int main()
{
    int n;
	cin>>n;
	string a,b;
	while(n--){
		int s,keta=0;
		cin>>a>>b;
		int ai[85]={},bi[85]={},sum[85]={};
		int as,bs;
		char c;
		as=a.size();
		bs=b.size();
		if(as>80||bs>80){
			cout<<"overflow"<<endl;
		}else{
			for(int i=0;i<as;i++){c=a[as-i-1];ai[i]=c-'0';}
			for(int i=0;i<bs;i++){c=b[bs-i-1];bi[i]=c-'0';}
			for(int i=0;i<=max(as,bs);i++){
				s=ai[i]+bi[i]+sum[i];
				if(s)keta=i;
				if(s>9){
					sum[i]=s%10;
					sum[i+1]++;
				}else{
					sum[i]=s;
				}
			}
			if(sum[80]){
				cout<<"overflow"<<endl;
			}else{
				for(int i=keta;i>=0;i--){
					cout<<sum[i];
				}
				cout<<endl;
			}

		}
	}
    return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
#include <list>
using namespace std;
 
int main()
{
    int n;
    cin>> n;
    string str1,str2;
    vector<string>s1;
    vector<string>s2;
    bool bo=false;
    for(int i=0;i<n;i++){
       cin>>str1;
       s1.push_back(str1);  
       cin>>str2;    
       s2.push_back(str2);
       if(str1.size()>80 ||str2.size()>80) bo=true;
    }
    if(bo){cout<<"overflow"<<endl;}
    else{
       for(int i=0;i<n;i++){
           string str3=s1[i];
           string str4=s2[i];
           int k=str3.size();
           int l=str4.size();
           int max=k>l?k:l;
           int a[80]={0};
           int b[80]={0};
           for(int j=0;j<k;j++){
                a[j]=str3[j]-'0'; } 
           for(int j=0;j<l;j++){
                b[j]=str4[j]-'0'; }
           int temp=0;
           char s[80];
           for(int i=0;i<max;i++){
               int d;
               if(l>i&&k>i) d=a[k-1-i]+ b[l-1-i]+temp;
               if(l<=i&&k>i) d=a[k-1-i]+temp;
               if(l>i&&k<=i) d=b[l-1-i]+temp;
               s[max-1-i]=(d%10)+'0';
               if(d>=10) temp=1;
               else temp=0;
           }
           if(strlen(s)+temp>80) cout<<"overflow"<<endl;
           else{ 
                 if(temp==1) cout<<"1";
                 for(int i=0;i<max;i++){
                    cout<<s[i];}
                }
          cout<<endl;
        } 
    }   
    return 0; 
}