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 <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
int to_int(char ch){ return ch - '0'; }
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s, t;
    int n;
    cin >> n;
    while(n--)
    {
        cin >> s >> t;
        if(s.size() < t.size()) swap(s, t);
        reverse(s.begin(), s.end());
        reverse(t.begin(), t.end());
        int up = 0;
        for(int i = 0; i < t.size(); i++)
        {
            int val = to_int(s[i]) + to_int(t[i]) + up;
            if(val > 9)
            {
                val -= 10;
                s[i] = val + '0'; 
                up = 1;
            }
            else
            {
                s[i] = val + '0';
                up = 0;
            }
        }
        int pos = t.size();
        while(up)
        {
            if(pos >= s.size()) break;
            if(to_int(s[pos]) + up > 9) s[pos] = '0';
            else up = 0;
            pos++;
        }
        if(up) s += '1';
        reverse(s.begin(), s.end());
        if(s.size() > 80) cout << "overflow" << endl;
        else cout << s << endl;
    }
    return 0;
}

C++: 
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
int main(){

    int n;
    cin >> n;
    while(n > 0){
        char a[2000] = {0};
        char b[2000] = {0};
        scanf("%s%s",a,b);
        int len_a = 0,len_b = 0;
        //長さを測る
        for(int i = 0; a[i] != 0; i++) len_a++;
        for(int i = 0; b[i] != 0; i++) len_b++;
        //もし80桁を超えてたらoverflowと出力
        if(len_a > 80 || len_b > 80){
            printf("overflow\n");
        }
        //80桁を超えてなかったら
        else{
            char ans[120] = {0};
            //aを逆向きに入れ替える
            for(int i = 0; i < len_a/2; i++){
                swap(a[i],a[len_a-i-1]);
            }
            //bを逆向きに入れ替ええる
            for(int i = 0; i < len_b/2; i++){
                swap(b[i],b[len_b-i-1]);
            }
            //aとbで長い方の長さをとる
            int len = max(len_a,len_b);
            //ここで足し算をする
            for(int i = 0; i < len; i++){
                if(ans[i] != 0){
                    if(a[i] == 0 || b[i] == 0)
                        ans[i] += a[i] + b[i] - '0';
                    else ans[i] += a[i] + b[i] - '0' - '0';

                }
                else if(a[i] == 0 || b[i] == 0) ans[i] += a[i] + b[i];
                else ans[i] += a[i] + b[i] - '0';
                if(ans[i] >= 58){
                    ans[i+1]+='1';
                    ans[i] -= 10;
                }
            }
            //このままではansが逆向きなので入れ替える
            for(int i = 0; i < strlen(ans)/2; i++){
                swap(ans[i],ans[strlen(ans)-i-1]);
            }

            int len_ans = 0;
            //ansの長さを測る
            for(int i = 0; ans[i] != 0; i++) len_ans++;
            //もし80桁を超えていたらoverflowと出力する
            if(len_ans > 80) printf("overflow");
            //それ以外なら一文字ずつ出力
            else for(int i = 0; ans[i] != 0; i++) printf("%c",ans[i]);
            printf("\n");
        }
        n--;
    }

    return 0;
}

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

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

    string c = "0123456789";
    for(int i=0; i<n; i++) {
        string in1, in2;
        cin >> in1 >> in2;
        if(in1.size() > 80 || in2.size() > 80) {
            cout << "overflow" << endl;
            continue;
        }

        string ans = "";
        int k = 0;
        for(int j=0; j<80; j++) {
            int x = in1.size() - 1 - j;
            if(x >= 0) {
                k += in1[x] - '0';
            }
            int y = in2.size() - 1 - j;
            if(y >= 0) {
                k += in2[y] - '0';
            }
            ans = c[k%10] + ans;
            k /= 10;
        }

        if(k!=0) {
            cout << "overflow" << endl;
        } else {
            bool flag = true;
            for(int i=0; i<ans.size(); i++) {
                if(ans[i] == '0' && flag) continue;
                flag = false;
                cout << ans[i];
            }
            if(flag) cout << "0";
            cout << 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 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(m_len>79){
				//cout<<"overflow"<<endl;
				//continue;
			//}
			//cout<<ans[m_len];
		}
		
		for(int i=0;i<mlen;i++){
			//cout<<ans[m_len-1-i];
		}cout<<endl;
		
		
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>

using namespace std;

void tasu(string s1, string s2){
        int num[2][max(s1.length(), s2.length())+1];
        for(int i = 0; i < sizeof(num[0])/sizeof(int); i++){
                if(s1.length() > i){ 
                        num[0][i] = (int)s1.at(s1.length()-1-i) - (int)'0';
                }else{
                        num[0][i] = 0;
                }   
                if(s2.length() > i){ 
                        num[1][i] = (int)s2.at(s2.length()-1-i) - (int)'0';
                }else{
                        num[1][i] = 0;
                }   
        }   
        for(int i = 0; i < sizeof(num[0])/sizeof(int)-1; i++){
                num[1][i] += num[0][i];
                if(num[1][i] > 9){ 
                        num[1][i+1] += (int)(num[1][i]/10);
                        num[1][i] %= 10; 
                }   
        }   
        int keta = sizeof(num[0])/sizeof(int);
        while(keta && !num[1][keta-1]){
                keta--;
        }   
        if(keta >= 80){
                cout << "overflow" << endl;
        }else{
                while(keta--){
                        cout << num[1][keta];
                }   
                cout << endl;
        }   
}
int main(){
        int n;
        cin >> n;
        while(n--){
                string s1, s2; 
                cin >> s1 >> s2; 
                tasu(s1, s2);
        }   
}