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 <cstdio>
#include <iostream>

using namespace std;

int main(void) {
	int sets;
	char input1[100], input2[100], out[100];
	int i1, i2, o, carry;
	int ic1, ic2;
	int i;

	cin >> sets;
	for(i=0;i<sets;i++) {
		scanf("%s", input1);
		for(i1=0;input1[i1] != '\0';i1++);
		if(i1 > 80) {
			printf("overflow\n");
		} else {
			scanf("%s", input2);
			for(i2=0;input2[i2] != '\0';i2++);
			if(i2 > 80) {
				printf("overflow\n");
			} else {
				i1--;i2--;o=0;carry=0;
				while(i1>=0 || i2>=0 || carry) {
					if(o > 80) { break; }
					if(i1>=0) { ic1 = input1[i1]-'0'; i1--; } else { ic1 = 0; }
					if(i2>=0) { ic2 = input2[i2]-'0'; i2--; } else { ic2 = 0; }
					if( ic1+ic2+carry < 10 ) { 
						out[o] = ic1+ic2+carry+'0';
						carry = 0;
					} else {
						out[o] = ic1+ic2+carry-10+'0';
						carry = 1;
					}
					o++;
				}
				if(o > 80) {
					printf("overflow\n");
				}
				else {
					for(o--;o>=0;o--) {
						printf("%c", out[o]);
					}
					printf("\n");
				}
			}
		}
	}

	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;


int main(){

	int n;
	cin >> n;
	for(int i=0 ; i<n ; i++){
		string a, b;
		cin >> a;
		cin >> b;

		if(b.size() > a.size()){
			string temp;
			temp = a;
			a = b;
			b = temp;
		}

		if(a.size() >= 80){
			cout << "overflow" << endl;
		}else{
			for(int j=0 ; j<b.size() ; j++){
				a[a.size()-1-j] = a[a.size()-1-j] + b[b.size()-1-j] -'0';
				if(a[a.size()-1-j] > '9'){
					a[a.size()-1-j] -= 10;
					for(int l=0 ; l<a.size()-1 ; l++){
						a[a.size()-2-l] ++;
						if(a[a.size()-2-l] > '9'){
							if(a.size()-2-l == 0){
								a = "0" + a;
							}
							a[a.size()-2-l] -= 10;
						}else break;
					}
				}
			}
		}
		cout << a << endl;

		}

	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include<string.h>
#include <utility>
using namespace std;
using namespace std;
int main(){
	int m;
	string in,in2;
	int a[90],b[90],ans[90];
	int f;
	int a_len,b_len,m_len;
	cin>>m;
	while(m--){
		for(int i=0;i<90;i++){
			a[i]=b[i]=ans[i]=0;
		}
		cin>>in;
		cin>>in2;
		a_len=in.size();
		b_len=in2.size();
		for(int i=0;i<a_len;i++){
			a[a_len-1-i]=in[i]-'0';
		}
		for(int i=0;i<b_len;i++){
			b[b_len-1-i]=in[i]-'0';
		}
		m_len=max(a_len,b_len);
		if(m_len>80){
			cout<<"overflow"<<endl;
			continue;
		}/*
		f=0;
		for(int i=0;i<m_len+1;i++){
			ans[i]=(a[i]+b[i]+f)%10;
			f=(a[i]+b[i]+f)/10;
		}
		if(ans[m_len]!=0){
			if(m_len>79){
				cout<<"overflow"<<endl;
				continue;
			}
			cout<<ans[m_len];
		}
		for(int i=0;i<m_len;i++){
			cout<<ans[m_len-1-i];
		}cout<<endl;
		
		*/
	}
	return 0;
}

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

void calcSum(string str1, string str2){
    int c = 0;
    string str = "";
    if (str1.size() > str2.size()){
        swap(str1, str2);
    }
    for (int i=0;i<(int)str1.size();i++){
        int sum = (str1[i] - '0') + (str2[i] - '0') + c;
        if (sum >= 10){
            str += (sum % 10) + '0';
            c = 1;
        }else{
            str += sum + '0';
            c = 0;
        }
    }
    for (int i=(int)str1.size();i<(int)str2.size();i++){
        int sum = (str2[i] - '0') + c;
        if (sum >= 10){
            str += (sum % 10) + '0';
            c = 1;
        }else{
            str += sum + '0';
            c = 0;
        }
    }
    if (c == 1)
        str += '1';
    reverse(str.begin(), str.end());
    if (str.size() > 80){
        cout << "overflow" << endl;
    }else{
        cout << str << endl;
    }
}

int main()
{
    int n;
    string str1, str2;
    
    cin >> n;
    for (int i=0; i<n; i++) {
        cin >> str1;
        cin >> str2;
        reverse(str1.begin(), str1.end());
        reverse(str2.begin(), str2.end());
        calcSum(str1, str2);
    }

    return 0;
}

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

int main() {
int N;
cin >> N;
for (; N > 0; --N) {
int a[80] = {}, b[80] = {}, sum[80] = {};
bool co = false;
string s, t;
cin >> s >> t;
for (int i = 0; i < s.length(); ++i) a[i] = (int)(s[i] - '0');
for (int i = 0; i < t.length(); ++i) b[i] = (int)(t[i] - '0');
for (int i = 0; i < 80; ++i) {
co = ((co?1:0)+a[i]+b[i]) >= 10;
sum[i] = ((co?1:0)+a[i]+b[i])%10;
}
if (co) cout << "overflow" << endl;
else {
bool fz = true;
for (int i = 79; i >= 0; --i)
if (fz && sum[i] != 0) {fz = false;}
if (!fz) cout << sum[i];
}
cout << endl;
}
return 0;
}

C++: #include<stdio.h>
#include<string.h>
char a[105],b[105];
int c[105],d[105],e[105];
int main()
{
    int n,len1,len2,z,k;
    while(~scanf("%d",&n))
    {
        while(n--)
        {
            memset(c,0,sizeof(c));
            memset(d,0,sizeof(d));
            memset(e,0,sizeof(e));
            scanf("%s",a);
            scanf("%s",b);
            len1=strlen(a);
            len2=strlen(b);
            z=0;
            for(int i=len1-1; i>=0; i--)
            {
                c[z++]=a[i]-'0';
            }
            z=0;
            for(int i=len2-1; i>=0; i--)
            {
                d[z++]=b[i]-'0';
            }
            k=len1>len2?len1:len2;
            for(int i=0; i<k; i++)
                e[i]=c[i]+d[i];
            for(int i=0; i<k; i++)
            {
                e[i+1]=e[i+1]+e[i]/10;
                e[i]=e[i]%10;
            }
            if(k>80)
            {
                printf("overflow");
                break;
            }
            if(e[k])
                printf("%d",e[k]);
            for(int j=k-1; j>=0; j--)
            {
                printf("%d",e[j]);
            }
            printf("\n");
        }
    }
     return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include<string.h>
#include <utility>
using namespace std;
using namespace std;
int main(){
	int m;
	string in,in2;
	int a[90],b[90],ans[90];
	int f;
	int a_len,b_len,m_len;
	cin>>m;
	while(m--){
		for(int i=0;i<90;i++){
			a[i]=b[i]=ans[i]=0;
		}
		cin>>in;
		cin>>in2;
		a_len=in.size();
		b_len=in2.size();
		for(int i=0;i<a_len;i++){
			a[a_len-1-i]=in[i]-'0';
		}
		for(int i=0;i<b_len;i++){
			b[b_len-1-i]=in[i]-'0';
		}
		m_len=max(a_len,b_len);
		if(m_len>80){
			cout<<"overflow"<<endl;
			continue;
		}
		f=0;
		for(int i=0;i<m_len+1;i++){
			ans[i]=(a[i]+b[i]+f)%10;
			f=(a[i]+b[i]+f)/10;
		}/*
		if(ans[m_len]!=0){
			if(m_len>79){
				cout<<"overflow"<<endl;
				continue;
			}
			cout<<ans[m_len];
		}
		for(int i=0;i<m_len;i++){
			cout<<ans[m_len-1-i];
		}cout<<endl;
		
		*/
	}
	return 0;
}