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>
#include <typeinfo>
#include <cmath>

using namespace std;

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

	string a, b, res;
	int temp, size, hoge, as, bs;
	for (int i = 0; i < n; i++) {
		cin >> a >> b;
		hoge = 0;
		res = "";

		as = a.size();
		bs = b.size();
		size = as > bs ? as : bs;
		while (a.size() < size) { a = "0" + a; }
		while (b.size() < size) { b = "0" + b; }

		for (int i = 0; i < size; i++) {
			temp = stoi(a.substr(size - i - 1, 1)) + stoi(b.substr(size - i - 1, 1)) + hoge;

			if (temp > 9) {
				res = to_string(temp % 10) + res;
				hoge = temp / 10;
			}
			else {
				res = to_string(temp % 10) + res;
				hoge = 0;
			}
		}
		if (hoge > 0) {
			res = to_string(hoge) + res;
		}
		
		if (res.size() > 80) {
			cout << "overflow";
		}
		else {
			cout << res;
		}
		cout << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
	int T;
	cin >> T;
	while(T--){
		//char s[100] = "abc";
		string a,b;
		
		cin >> a >> b;
		if(a==0&&b==0){cout<<0<<endl;continue;}
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());
		while( a.size() < 100 ) a += "0";
		while( b.size() < 100 ) b += "0";
		string ans = "";
		int carry = 0;
		for(int i = 0 ; i < 100 ; i++){
			int d = (a[i]-'0') + (b[i]-'0') + carry;
			ans += d % 10 + '0';
			carry = d / 10;
		}
		reverse(ans.begin(),ans.end());
		if(ans.find_first_not_of('0')<20){
			cout << "overflow" << endl;
			continue;
		}
		ans = ans.substr(ans.find_first_not_of('0') );
		
		cout << ans << endl;
	}
	
	return 0;
}

C++: #include <stdio.h>
#include <string.h>

#define MAX_DIGIT 80


void add(char *buf1, char *buf2){
	int len1 = strlen(buf1);
	if(len1 > MAX_DIGIT){
		printf("overflow\n");
		return;
	}
	int len2 = strlen(buf2);
	if(len2 > MAX_DIGIT){
		printf("overflow\n");
		return;
	}
	
	int big1[MAX_DIGIT + 1] = {}, big2[MAX_DIGIT + 1] = {};
	
	for(int i = 0; i < len1; i++){
		big1[len1 - i - 1] = buf1[i] - 48;
	}
	for(int i = 0; i < len2; i++){
		big2[len2 - i - 1] = buf2[i] - 48;
	}
	
	int len = (len1 > len2) ? len1 : len2;
	for(int i = 0; i < len; i++){
		big1[i] += big2[i];
		if(big1[i] >= 10){
			big1[i + 1]++;
			big1[i] -= 10;
		}
	}
	
	int j = len + 1;
	for(; j >= 0; j--){
		if(big1[j] > 0){
			break;
		}
	}
	if(j >= MAX_DIGIT){
		printf("overflow\n");
		return;
	}
	for(; j >= 0; j--){
		printf("%d", big1[j]);
	}
	printf("\n");
}

int main(){
	int n;
	char buf1[101], buf2[101];
	
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%s", buf1);
		scanf("%s", buf2);
		add(buf1, buf2);
	}
	
	return 0;
}

C++: #include <stdio.h>
#include <string.h>

char s1[100];
char s2[100];

int n1[100];
int n2[100];

int no[100];
char so[100];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i = 0; i < n; i++)
	{
		scanf("%s",s1);
		scanf("%s",s2);
		int l = strlen(s1);
		for(int i = 0; i < l; i++)
		{
			n1[i] = s1[l - 1 - i] - '0';
		}
		for(int i = l; i < 80; i++)
		{
			n1[i] = 0;
		}
		l = strlen(s2);
		for(int i = 0; i < l; i++)
		{
			n2[i] = s2[l - 1 - i] - '0';
		}
		for(int i = l; i < 80; i++)
		{
			n2[i] = 0;
		}
		int keta = 0;
		for(int i = 0; i < 80; i++)
		{
			int w = n1[i] + n2[i] + keta;
			no[i] = w % 10;
			keta = w / 10;
		}
		if(keta != 0)
		{
			printf("overflow\n");
		}
		else
		{
			int b = 0;
			for(int i = 80 - 1; i >= 0; i--)
			{
				if(b != 0 || no[i] != 0)
				{
					so[b] = no[i] + '0';
					b++;
				}
			}
			if(b == 0)
			{
				printf("0\n");
			}
			else
			{
				so[b] = '\0';
				printf("%s\n",so);
			}
		}
	}
	return 0;
}

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

int sum(char a[],char b[],int as,int bs,char c[]){
	int cs = (as>bs) ? as + 1 : bs + 1;
	int size = cs;
	while(as >=0 && bs >=0){
		c[cs] = a[as] + b[bs];
		if(c[cs]>9){
			c[cs] -= 10;
			c[cs-1] += 1;
		}
		as--;bs--;cs--;
	}
	while(as >=0){
		c[cs] += a[as];
		if(c[cs]>9){
			c[cs] -= 10;
			c[cs-1] += 1;
		}
		as--;cs--;
	}
	while(bs >=0){
		c[cs] += b[bs--];
		if(c[cs]>9){
			c[cs] -= 10;
			c[cs-1] += 1;
		}
		cs--;
	}
	return (c[0]>0) ? size + 1 : size;
}

int main(){
	char a[256],b[256],c[256];
	bool flag = true;
	int len1,len2,len3,n;
	scanf("%d",&n);
	while(n--){
		scanf("%s",a);
		scanf("%s",b);
		len1 = strlen(a);
		len2 = strlen(b);
		if(len1 > 80 || len2 >80){
			printf("overflow\n");
			continue;
		}
		for(int i=0;i<len1;i++) a[i] -= 0x30;
		for(int i=0;i<len2;i++) b[i] -= 0x30;
		for(int i=0;i<256;i++)  c[i] = 0;
		len3 = sum(a,b,len1-1,len2-1,c);
		if(len3>80){
			printf("overflow\n");
			continue;
		}
		if(c[0]>0) for(int i=0;i<len3;i++) printf("%d",c[i]);
		else for(int i=1;i<=len3;i++) printf("%d",c[i]);
		printf("\n");
	}
	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--) {
        fill_n(A, 81, '\0');
        fill_n(B, 81, '\0');
        string input;
        cin >> input;
        copy(input.rbegin(), input.rend(), A);
        cin >> input;
        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;
    }
}

C++: #include<string>
#include<vector>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<sstream>
#include<functional>
#include<map>
#include<stack>
#include<set>
#include<cmath>

#define REP(i,s,e) for(int i=int(s);i<int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)

#define EPS 1e-6

using namespace std;

int main(){

	int n;
	cin >> n;

	rep(i,n){

	string a,b;
	cin >> a >> b;

	int sa=a.size(); int sb=b.size(); int p=max(sa,sb);
	vector<char>s;

	if(sa>80 || sb>80)
	cout << "overflow" << endl;
	else{

	string z;
	if(sa>sb){
	rep(j,sa-sb)
	z+='0';
	b=z+b;
	}
	if(sb>sa){
	rep(j,sb-sa)
	z+='0';
	a=z+a;
	}


    int c=0;
	rep(j,p){

	c+=(a[p-1-j]-'0')+(b[p-1-j]-'0');

	s.push_back(c%10+'0');
	c=c/10;

	}

    if(c==1) s.push_back(c%10+'0');

    if(s.size()>80)
    cout << "overflow" << endl;
    else
    rep(k,s.size()) cout << s[s.size()-1-k];

    cout << endl;
    s.clear();

	}
	}

	return 0;
}