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<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;


int main(){
    int t;
    scanf("%d",&t);
    while(t--){
        char c1[1000],c2[1000];
        scanf("%s",&c1);
        scanf("%s",&c2);
        string s1,s2;
        s1=c1, s2=c2;
        if(s1=="0" && s2=="0"){
            printf("0\n");
            continue;
        }
        reverse(s1.begin(),s1.end());
        reverse(s2.begin(),s2.end());
        int n=max(s1.size(),s2.size())+1;
        for(int i=s1.size();i<n;i++){
            s1+='0';
        }
        for(int i=s2.size();i<n;i++){
            s2+='0';
        }
        string res;
        int b=0;
        for(int i=0;i<max(s1.size(),s2.size());i++){
            int u=s1[i]-'0'+s2[i]-'0'+b;
            b=(u>=10); u%=10;
            res+=u+'0';
        }

        reverse(res.begin(),res.end());
        string res2;
        int j=0;
        while(res[j]=='0') j++;
        for(;j<res.size();j++){
            res2+=res[j];
        }

        if(res2.size()>80){
            printf("overflow\n");
        }else{
            printf("%s\n",res2.c_str());
        }
    }
    return 0;
}

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;
}