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>
using namespace std;
char str[102],str1[102],ans[102];
int sam(int ma1,int ma2)
{
    int co,carry=0,a,b;
    for(int i=0;ma1-i>=0||ma2-i>=0||carry==1;i++){
            if(ma1-i>=0&&ma2-i>=0){
                    a=str[ma1-i]-'0';
                    b=str1[ma2-i]-'0';
                    if(a+b+carry>=10){
                        ans[i]=a+b+carry-10+'0';
                        carry=1;
                    }
                    else {
                        ans[i]=a+b+carry+'0';
                        carry=0;
                    }
            }
            else if(ma1-i>=0){
                    a=str[ma1-i]-'0';
                    if(a+carry>=10){
                        ans[i]=a+carry-10+'0';
                        carry=1;
                    }
                    else {
                        ans[i]=a+carry+'0';
                        carry=0;
                    }
            }
            else if(ma2-i>=0){
                    b=str1[ma2-i]-'0';
                    if(b+carry>=10){
                        ans[i]=b+carry-10+'0';
                        carry=1;
                    }
                    else {
                        ans[i]=b+carry+'0';
                        carry=0;
                    }
            }
            else {
                ans[i]='0'+1;
                return i;
            }
        co=i;

    }
    return co;

}
int main()
{
    int a,b,n;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>str>>str1;
        a=strlen(str);
        b=strlen(str1);
        a=sam(a,b);
        if(a>80)cout<<"overflow\n";
        else for(int j=a;j>0;j--)cout<<ans[j];
        cout<<endl;
    }

}

C++: #include <iostream>
#include <string>
using namespace std;
int main()
{
	int N; cin >> N ;
	for(int i=0;i<N;i++)
	{
		string str,ptr,temp,ans; cin >> str >> ptr ;
		int lens,lenp,len;
		lens=str.size(); lenp=ptr.size();
		bool flag=false; len=max(lens,lenp);
		temp=str; for(int i=0;i<lens;i++) str[i]=temp[lens-i-1];
		temp=ptr; for(int i=0;i<lenp;i++) ptr[i]=temp[lenp-i-1];
		for(int i=0;i<len;i++)
		{
			int temp;
			if(i>=lens && i<lenp) temp=ptr[i]-'0';
			else if(i<lens && i>=lenp) temp=str[i]-'0';
			else temp=(str[i]-'0')+(ptr[i]-'0'); 
			if(flag==true) temp++,flag=false;
			if(temp>=10) flag=true,temp%=10;
			char ch='0'+temp;
			if(!i) ans=ch;
			else ans+=ch;
		}
		if(flag==true) ans+='1';
		temp=ans; int LEN=ans.size();
		for(int i=0;i<LEN;i++) ans[i]=temp[LEN-i-1];
		if(LEN>80) ans="overflow";
		cout << ans << '\n' ;
	}
}

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
	int n;
	cin >> n;
	while(n--){
		string a, b;
		bool cu = false;
		cin >> a >> b;
		int al = a.length(), bl = b.length(), ans[101] = {0};
		for(int i = 0; i < min(al, bl); i++){
			ans[i] = a[al-i-1] + b[bl-i-1] - 48 * 2;
			if(cu) ans[i]++;
			if(ans[i] >= 10){
				ans[i] %= 10;
				cu = true;
			}else cu = false;
		}
		for(int i = min(al, bl); i < max(al, bl); i++){
			if(al > bl) ans[i] = a[al-i-1] - 48 + cu;
			else ans[i] = b[bl-i-1] - 48 + cu;
			if(ans[i] >= 10){
				ans[i] %= 10;
				cu = true;
			}else cu = false;
		}
		if(cu) ans[max(al, bl)] = 1;
		if(max(al, bl)+cu > 80) cout << "overflow" << endl;
		else for(int i = (cu? max(al, bl):max(al, bl)-1); i >= 0; i--) cout << ans[i];
		cout << endl;
	}
	return 0;
}

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

string Sum(string& FirstInteger, string& SecondInteger)
{
	int Degit;
	string AddedZero;
	if(FirstInteger.size() < SecondInteger.size()){
		Degit = SecondInteger.size();
		for(int i = 0; i < Degit - FirstInteger.size(); i++){
			AddedZero.push_back('0');
		}
		FirstInteger = AddedZero + FirstInteger;
	}else{
		Degit = FirstInteger.size();
		for(int i = 0; i < Degit - SecondInteger.size(); i++){
			AddedZero.push_back('0');
		}
		SecondInteger = AddedZero + SecondInteger;
	}
//	cout << FirstInteger << '+' << endl << SecondInteger << endl;
	string SumInteger;
	SumInteger.resize(Degit);
	bool IsMoveUp  = false;
	bool WasMoveUp = false;
	for(int i = 0; i < Degit; i++){
		WasMoveUp = IsMoveUp;
		int Sum = WasMoveUp + FirstInteger[Degit-1-i] - '0' + SecondInteger[Degit-1-i] - '0';
		if(Sum >= 10){
			IsMoveUp = true;
			Sum -= 10;
		}else{
			IsMoveUp = false;
		}
		SumInteger[Degit-1-i] = Sum + '0';
	}
	if(IsMoveUp == true){
	    return '1' + SumInteger;
	}else{
	    return SumInteger;
	}
}

int main()
{
	int N;
	cin >> N;
	for(int i = 0; i < N; i++){
		string FirstInteger, SecondInteger;
		cin >> FirstInteger >> SecondInteger;
//		cout << FirstInteger << '+' << SecondInteger << endl;
		string SumInteger = Sum(FirstInteger, SecondInteger);
//		cout << SumInteger.size() << "keta" << endl;
		if(SumInteger.size() <= 80){
//		    cout << "c" << endl;
		    cout << SumInteger.c_str() << endl;
//			cout << "b" << endl;
		}else{
			cout << "overflow" << endl;
		}
//		cout << "a" << endl;
	}
	return 0;
}

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

int main()
{
    int number_of_datasets;
    cin >> number_of_datasets;

    char A[81];
    char B[81];
    while (number_of_datasets-- > 0) {
        fill_n(A, 81, '\0');
        fill_n(B, 81, '\0');
        string input;
        cin >> input;
        if (input.length() > 80) {
            cin >> input;
            cout << "overflow" << endl;
            continue;
        }
        copy(input.rbegin(), input.rend(), A);
        cin >> input;
        if (input.length() > 80) {
            cout << "overflow" << endl;
            continue;
        }
        copy(input.rbegin(), input.rend(), B);

        for (char & n : A) {
            if (n == '\0') {
                break;
            }

            n -= '0';
        }

        for (char & n : B) {
            if (n == '\0') {
                break;
            }

            n -= '0';
        }

        char carry = 0;
        for (int i = 0; i < 81; i++) {
            A[i] += B[i] + carry;
            if (A[i] >= 10) {
                A[i] -= 10;
                carry = 1;
            } else {
                carry = 0;
            }
        }
        
        if (A[80] != 0) {
            cout << "overflow";
        } else {
            int last_valid_place = 0;
            for (int i = 80; i >= 0; i--) {
                if (A[i] != 0) {
                    last_valid_place = i;
                    break;
                }
            }

            for (int i = last_valid_place; i >= 0; i--) {
                A[i] += '0';
                cout << A[i];
            }
        }

        cout << endl;
    }
}