Go: package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Scan()
	dataset, _ := strconv.Atoi(sc.Text())
	var firstdata *big.Int

	for i := 0; i < dataset*2; i++ {
		n := new(big.Int)
		sc.Scan()
		data, _ := n.SetString(sc.Text(), 10)

		if i%2 == 0 {
			firstdata = data
			continue
		}

		result := new(big.Int)
		if result := result.Add(data, firstdata); len(result.String()) > 80 {
			fmt.Println("overflow")
			continue
		} else {
			fmt.Println(result)
		}
	}
}

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

int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i)
	{
		int A[150] = {},B[150] = {},C[150] = {};
		string inA,inB;
		cin >> inA >> inB;
		for (int j = 0; j < inA.size(); ++j)
			A[inA.size()-j] = (int)(inA[j]-'0');
		for (int j = 0; j < inB.size(); ++j)
			B[inB.size()-j] = (int)(inB[j]-'0');
		int keta = 0;
		for (int j = 1; j < 150; ++j)
		{
			C[j] += A[j] + B[j];
			if(C[j] >= 10)
			{
				C[j+1] += C[j]/10;
				C[j] = C[j]%10;
			}
			if(C[j] != 0)
				keta = j;
		}
		cout << keta << endl;
		if(keta >= 80)
			cout << "overflow" << endl;
		else
		{
			bool haji = 0;
			for (int j = 149; j > 0; --j)
			{
				if(C[j] != 0)
					haji = 1;
				if(haji)
				{
					cout << C[j];
				}
			}
			cout << endl;
		}
	}
}

C++: #include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;

int main(void)
{
int N,j,k=0;
cin >> N;
char strA[300],strB[300];
while(1){
k++;
if(k==N+1){
break;
}
cin >> strA >> strB;
int ans[81]={0};
ans[0]=11111;
if(strlen(strA)>80||strlen(strB)>80){
cout << "overflow" << endl;
continue;
}
int a[81]={0},b[81]={0};
j=strlen(strA)-1;
for(int i=80 ; j>=0 ; i--){
a[i]=(int)strA[j]-48;
j--;
}
j=strlen(strB)-1;
for(int i=80 ; j>=0 ; i--){
b[i]=(int)strB[j]-48;
j--;
}
for(int i=80 ; i!=0 ; i--){
ans[i]=ans[i]+a[i]+b[i];
if(ans[i]>=10){
ans[i]=ans[i]-10;
ans[i-1]++;
}
}
if(ans[0]!=11111){
cout << "overflow" << endl;
continue;
}
for(int i=1 ; i<81 ; i++){
if(ans[i]!=0){
j=i;
break;
}
}
char c[3];
for(int i=j ; i<81 ; i++){
printf("%c",ans[i]+48);
}
cout << '\n';
}
return 0;
}

C++: //56
#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

int main(){
  int N;
  cin>>N;
  while(N--){
    string s[2];
    for(int i=0;i<2;i++){
      cin>>s[i];
      reverse(s[i].begin(),s[i].end());
    }
    if(s[0].size()<s[1].size()){
      swap(s[0],s[1]);
    }
    string ans;
    int c=0;
    for(int i=0;i<s[0].size();i++){
      char d=(i<s[1].size())?s[1][i]:'0';
      d+=-'0'+s[0][i]+c;
      c=d>'9';
      if(d>'9'){
	d-=10;
      }
      ans+=d;
    }
    if(c){
      ans+='1';
    }
    reverse(ans.begin(),ans.end());
    cout<<ans<<endl;
  }
  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\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<algorithm>
#include<iostream>
#include<cstdio>
#include<stdio.h>
#include<string>
#include<string.h>
#include <math.h>
using namespace std;
int main()
{
	char a1, a2;
	long long a, b, c;
	int kaisu = 0;
	cin >> kaisu;
	for (int i = 0; i < kaisu; i++)
	{
		cin >> a;
		cin >> b;
		a1 = (long long)log10(a) + 1;;
		a2 = (long long)log10(b) + 1;;
		if (a1 + a2 >= 80) { cout << "overflow" << endl; }
		else {
			c = a + b; cout
				<< c << endl;
		}
	}
	return 0;
}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <algorithm>
#include <cstring>		//strlen

using namespace std;



bool solve(){

//	なぜかわからないがstirngだと数字が大きいとSegmentation fault
/*
	string str1,str2;
	cin>> str1>> str2;
	int n1 = str1.size();
	int n2 = str2.size();
*/	
	char str1[100],str2[100];
	scanf("%s %s",str1,str2);
	int n1 = strlen(str1);
	int n2 = strlen(str2);
	
	int n  = max(n1,n2);

/*	string str="";
*/
	char str[1000];
	int c = 0;
	int i=0;
	while(i<n){
		int a = c;
		if(i<n1){
			a += (str1[n1-i-1]-'0');
		}
		if(i<n2){
			a += (str2[n2-i-1]-'0');
		}
		c = a/10; 
		a = a%10;
		
		str[i] = a + '0';
		i++;
	}
	if(c){
		str[i] = c + '0';
		i++;
	}
	
	if(i>81){
		cout<< "overflow"<<endl;
		return true;
	}
	
	for(int j=i-1;j>=0;j--){
		cout<< str[j];
	}
	cout<<endl;
	
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(5);
	int n;
	cin>> n;
	for(int i=0;i<n;i++){
		solve();
	}
	return 0;
}