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

using namespace std;

#define MAX(x,y) ((x>y)? x:y)


int n;//データセットの数

char str[2][10000];//	入力される整数文字列
int n_str[2];//長さを収納

char answer[85];

FILE *fp=stdin;

int main()
{
	fscanf(fp,"%d",&n);
	for(int i=0;i<n;i++)
	{
		sta:
		fscanf(fp,"%s%s",&str[0],&str[1]);
		for(int j=0;j<2;j++)n_str[j]=strlen(str[j]);
		int max =0,min=1;
		if(n_str[1]>n_str[0])
		{
			max=1;
			min=0;
		}
		int s = n_str[max]-n_str[min];
		char cha[85];
		fill(cha,cha+80,'0');
		for(int j=n_str[min];j>=0;j--)
		{
			cha[j+s]=str[min][j];
		}
		strcpy(str[min],cha);
		fill(answer,answer+85,0);
		for(int j=n_str[max]-1;j>=0;j--)
		{
			answer[j]=str[0][j]+str[1][j]-'0';
			if(answer[j]>'9')//繰り上がり時の処理
			{
				answer[j]-=10;
				if(j==0)
				{
					if(n_str[max]>=80)
					{
						n_str[max]++;
					}

					else printf("1");
				}
				else str[0][j-1]++;
			}
		}
		if(n_str[max]>80)
		{
			printf("overflow\n");
		}
		else printf("%s\n",answer);
	}
	fclose(fp);
	return 0;
}

C++: //#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
//#include "bits/stdc++.h"

#define rep(i,n) for(ll (i)=0;(i)<(ll)(n);(i)++)
#define all(x) (x).begin(),(x).end()

#define MOD 1000000007LL
#define INF (1LL<<60LL)
#define int long long
#define MAX_N (100001)
typedef long long ll;

using namespace std;

string stringsum(string s1, string s2) {
	if (s1 == s2 && s1 == "0") return "0";
	string s;
	reverse(all(s1));
	reverse(all(s2));
	int len1 = s1.size();
	int len2 = s2.size();
	bool up = false;
	for(int i=0;i<=100;i++) {
		//cout << i << endl;
		if (len1 <= i && len2 <= i)break;
		int k = 0;
		if (up) {
			k++;
			up = false;
		}
		string c;
		if (len1>i){
			c = s1[i];
			k += stoi(c);
		}
		if (len2 > i) {
			c = s2[i];
			k += stoi(c);
		}
		if (k >= 10) {
			up = true;
			k -= 10;
		}
		s += to_string(k);
		//cout << k << " ";
		//cout << s << endl;
	}
	if (up)s += '1';
	reverse(all(s));
	return s;
}


signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n; cin >> n;
	rep(i, n) {
		string s1, s2;
		cin >> s1 >> s2;
		string s;
		s = stringsum(s1, s2);
		if (s.size() > 80) cout << "overflow" << endl;
		else cout << s << endl;
	}
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<stack>
#include<algorithm>
using namespace std;
string str1;
string str2;
stack<int> sta;

int main()
{
  int n;
  int i,j;
  int exc;//??°?????????
  int sum;

  cin>>n;
  for(i=0;i<n;i++){
    cin>>str1;
    cin>>str2;
    if(str1.size()>=80 || str2.size()>=80){
      cout<<"overflow"<<endl;
      return 0;
    }
    exc=0;
    for(j=1;j<=min(str1.size(),str2.size());j++){
      sum=str1[str1.size()-j]-'0'+str2[str2.size()-j]-'0'+exc;
      exc=sum/10;
      sta.push(sum%10);
    }
    if( str1.size() < str2.size() ){
      while(j<=str2.size()){
	sum=str2[str2.size()-j]-'0'+exc;
	exc=sum/10;
	sta.push(sum%10);
	j++;
      }
    }else if( str1.size() > str2.size() ){
      while(j<=str1.size()){
	sum=str1[str1.size()-j]-'0'+exc;
	exc=sum/10;
	sta.push(sum%10);
	j++;
      }
    }
    if(max(str1.size(),str2.size())==79 && exc==1){
      cout<<"overflow"<<endl;
      return 0;
    }
    if(exc)
      cout<<exc;
    for(j=0;j<max(str1.size(),str2.size());j++){  
      cout<<sta.top();
      sta.pop();
    }
    cout<<endl;
  }
}

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\n%s", &inputA, &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])) {
            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<stdio.h>
#include<math.h>
#include<string.h>

int main(void){

	int N,math1,math2,kuri,keta;
	int i,j,k;
	char fi[100],se[100],ans[100];

	scanf("%d",&N);

	for(i=0;i<N;i++){

		scanf("%s",&fi);
		scanf("%s",&se);

		
		for(j=strlen(fi)-1,k=strlen(se)-1,keta=0,kuri=0;j>=0||k>=0;j--,k--,keta++){
			if(j<0) math1=0;
			else math1=fi[j]-'0';
			if(k<0) math2=0;
			else math2=se[k]-'0';
            /*ans[keta]=((math1+math2+kuri)%10)+'0';*/
			kuri=(math1+math2+kuri)/10;
		}
		if(kuri==1) printf("1");
		if(keta-1<=80){
			for(j=keta-1;j>=0;j--){
				printf("%c",ans[j]);
			}
		}
		else printf("overflow");
		printf("\n");
	}

	return 0;
}