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<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 alen,blen,mlen;
	cin>>m;
	while(m--){
		for(int i=0;i<90;i++){
			a[i]=b[i]=ans[i]=0;
		}
		cin>>in;
		cin>>in2;
		alen=in.size();
		blen=in2.size();
		for(int i=0;i<alen;i++){
			a[alen-1-i]=in[i]-'0';
		}
		for(int i=0;i<blen;i++){
			b[blen-1-i]=in[i]-'0';
		}
		mlen=max(alen,blen);
		if(mlen>80){
			cout<<"overflow"<<endl;
			continue;
		}
		f=0;
		for(int i=0;i<mlen+1;i++){
			ans[i]=(a[i]+b[i]+f)%10;
			f=(a[i]+b[i]+f)/10;
		}
		if(ans[mlen]!=0){
			//if(mlen>79){
				//cout<<"overflow"<<endl;
				//continue;
			//}
			//cout<<ans[mlen];
		}
		
		for(int i=0;i<mlen;i++){
			//cout<<ans[mlen-1-i];
		}cout<<endl;
		
		
	}
	return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<list>
#include<map>
#include<vector>
#include<algorithm>
#include<string.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << x << endl;
using namespace std;

const int MAX = 81;

int main(){
    int n;
    cin >> n;
    while(n--){
        vector<int> ans;
        string input1, input2;
        int len1, len2, up = 0;
        
        cin >> input1 >> input2;
        len1 = input1.length() - 1;
        len2 = input2.length() - 1;
        reverse(input1.begin(), input1.end());
        reverse(input2.begin(), input2.end());

        rep(i,MAX){
            int add = up;
            if(i <= len1){
                add+= input1[i] - '0';
            }
            if(i <= len2){
                add+= input2[i] - '0';
            }
            if(!(add == 0 && i > len1 && i > len2))
            ans.push_back(add % 10);
            up = add / 10;
            if(i > len1 && i > len2) break;
        }

        if(ans.size() > 80){
            cout << "overflow" << endl;
        }else{
            vector<int>::iterator it;
            it = ans.end();
            while(ans.size() != 0){
                --it;
                cout << *it;
                ans.pop_back();
            }cout << endl;
        }
    }
}

C++: #include <iostream>
#include <string>
#include <cmath>

using namespace std;

int main() {
	int N, c = 0, tmp;
	cin >> N;
	string ans;
	for (int i = 0; i < N; i++) {
		ans = "";
		string a, b;
		cin >> a >> b;
		for (int j = 0; j < max(a.length(), b.length()); j++) {
			int A, B;
			A = a.length() - j - 1;
			B = b.length() - j - 1;
			tmp = (A >= 0 ? a[A] - '0' : 0) + (B >= 0 ? b[B] - '0' : 0) + c;
			ans = (char)(tmp % 10 + '0') + ans;
			c = tmp / 10;
		}
		if (c) {
			ans = '1' + ans;
		}
		cout << (ans.length() >= 80 ? "overflow" : ans) << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
using namespace std;

int main() {
	string a;
	string b;
	int n;
	cin >> n;
	for (int i = 0; i < n;i++) {
		cin >> a >> b;
		string ans;
		if (a.size() < b.size()) {
			swap(a, b);
		}
		int back = 0;
		for (int j = 1; j <=a.size(); j++) {
			int d = a[a.size() - j] - '0' + b[b.size() - j] - '0' + back;
			ans = (char)(d % 10 + '0') + ans;
			back = d / 10;
		}
		if (back == 1) {
			ans = "1" + ans;
		}
		if (ans.size() > 80) {
			cout << "overflow" << endl;
		}
		else {
			cout << ans << endl;
		}
	}
	return 0;
}

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

int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
	string a,b,c;
	cin>>a>>b;
	if(a.size()<b.size())swap(a,b);
	int as=a.size(),bs=b.size();
	for(int i=0;i<as-bs;i++)b="0"+b;
	c=a;
	bool kuri=false;
	int sum=0;
	for(int i=a.size()-1;i>=0;i--){
		 sum=a[i]-'0';
		char now;
		sum=sum+b[i]-'0';
		if(kuri)sum++;
		if(sum>=10){
			kuri=true;
				sum-=10;
				//cout<<"a";
		}
		else{
			kuri=false;
		}
		now=sum+'0';
		//cout<<sum;
		c[i]=now;
	}
	if(kuri)c="1"+c;
	
	if(c.size()>80)cout<<"overflow"<<endl;
	else cout<<c<<endl;
	c.clear();
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
    int num; cin >> num;
    for(int k = 0; k < num; k++) {
        string s1, s2, ret;
        vector<int> v1, v2;
        cin >> s1 >> s2;
        if(s2.length() > s1.length()) swap(s1,s2);
        for(int i=0; i<s1.length(); i++) v1.push_back((int)s1[i] - 48);
        for(int i=0; i<s2.length(); i++) v2.push_back((int)s2[i] - 48);

        reverse(v1.begin(), v1.end());
        reverse(v2.begin(), v2.end());

        int n = 0;
        for(int i=0; i<v2.size(); i++) {
            ret += to_string((v1[i] + v2[i] + n) % 10);
            if(v1[i] + v2[i] + n >= 10) n = 1;
            else n = 0;
        }
        for(int i=v2.size(); i<v1.size(); i++) {
            ret += to_string((v1[i] + n) % 10);
            if(v1[i] + n >= 10) n = 1;
            else n = 0;
        }
        if(v1[v1.size() - 1] + n == 10) ret += "1";

        reverse(ret.begin(), ret.end());
        cout << ret << endl;
    }
    return 0;
}

C++: #include <iostream>

int main()
{
        char a[81], b[81];
        int c[80], ca, cb, set, up = 0;
        std::cin >> set;

        for(int i = 0; i < set; ++i)
        {
                for(int j = 0; j < 80; ++j)
                        c[j] = 0;
                up = ca = cb = 0;
                std::cin >> a >> b;

                for(int j = 0; j < 81; ++j)
                        if((a[j] - '0' < 0) || (a[j] - '0' > 9))
                        {
                                ca = j - 1;
                                break;
                        }

                for(int j = 0; j < 81; ++j)
                        if((b[j] - '0' < 0) || (b[j] - '0' > 9))
                        {
                                cb = j - 1;
                                break;
                        }

                for(int j = 0; j < 80; ++j)
                {
                        if(ca < j && cb < j)
                        {
                                c[j] = up % 10;
                                up = up / 10;
                        }
                        else if(ca < j)
                        {
                                c[j] = (b[cb - j] - '0' + up) % 10;
                                up = (b[cb - j] - '0' +up) / 10;
                        }
                        else if(cb < j)
                        {
                                c[j] = (a[ca - j] - '0' + up) % 10;
                                up = (a[ca - j] - '0' +up) / 10;
                        }
                        else
                        {
                                c[j] = (a[ca - j] - '0' + b[cb - j] - '0' + up) % 10;
                                up = (a[ca -j] - '0' + b[cb - j] - '0' +up) / 10;
                        }
                }

                if(up > 0)
                {
                        std::cout << "overflow" << std::endl;
                        break;
                }

                int k;
                for(int j = 0; j < 80; ++j)
                        if(c[79 - j])
                        {
                                k = j;
                                break;
                        }

                for(int j = k; j < 80; ++j)
                        std::cout << c[79 - j];
                std::cout << std::endl;
        }
}