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 <stack>
#include <cstdlib>

using namespace std;

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

  for (int N_i = 0; N_i < N; N_i++) {
    bool overflow = false;
    string str_data1, str_data2;
    cin >> str_data1;
    cin >> str_data2;

    stack<int> data1, data2; 
    for (int data1_i = 0; data1_i < str_data1.size(); data1_i++) {
      char buff[2];
      buff[0] = str_data1[data1_i];
      buff[1] = '\0';
      data1.push(atoi(buff));
    }
    if (data1.size() > 80)
      overflow = true;
    for (int data2_i = 0; data2_i < str_data2.size(); data2_i++) {
      char buff[2];
      buff[0] = str_data2[data2_i];
      buff[1] = '\0';
      data2.push(atoi(buff));
    }
    if (data2.size() > 80)
      overflow = true;

    stack<int> sum;
    int carry = 0;
    int flag = data1.size() < data2.size() ? 0 : 1;
    while(flag == 0 ? !data1.empty() : !data2.empty()) {
      int presum = data1.top() + data2.top() + carry;
      carry = presum / 10;
      sum.push(presum % 10);
      data1.pop();
      data2.pop();
    }
    stack<int> *data;
    data = data1.size() > data2.size() ? &data1: &data2;
    while(!data->empty()) {
      int presum = data->top() + carry;
      carry = presum / 10;
      sum.push(presum % 10);
      data->pop();
    }

    if (carry != 0)
      sum.push(carry);

    if (sum.size() > 80)
      overflow = true;

    if (overflow) {
      cout << overflow << endl;
    } else {
      for (int sum_i = 0; !sum.empty(); sum_i++) {
        cout << sum.top();
        sum.pop();
      }
      cout << endl;
    }
  }

  return 0;
}

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

using namespace std;

char c[10] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};

int main() {
	int n; cin >> n;
	string s1, s2;
	
	for (int i=0; i<n; i++) {
		cin >> s1 >> s2;
		reverse(s1.begin(), s1.end());
		reverse(s2.begin(), s2.end());
		
		string s = "";
		
		if (s1.size() == s2.size()) {
			int r = 0, t = 0;
			for (int i=0; i<(int)s1.size(); i++) {
				int x = s1[i]-c[0], y = s2[i]-c[0];
				int z = x + y + t;
				r = z%10;
				t = z/10;
				s += c[r];
			}
			if (t) s += c[t];
		} else if (s1.size() > s2.size()) {	
			int r = 0, t = 0;
			for (int i=0; i<(int)s2.size(); i++) {
				int x = s1[i]-c[0], y = s2[i]-c[0];
				int z = x + y + t;
				r = z%10;
				t = z/10;
				s += c[r];
			}
			if (t) {
				for (int i=(int)s2.size(); i<(int)s1.size(); i++) {
					int z = s1[i]-c[0]+t;
					r = z%10;
					t = z/10;
					s += c[r];
				}
				if (t) s += c[t];
			} else {
				for (int i=(int)s2.size(); i<(int)s1.size(); i++) s += c[s1[i]-c[0]];
			}
		} else {
			int r = 0, t = 0;
			for (int i=0; i<(int)s1.size(); i++) {
				int x = s1[i]-c[0], y = s2[i]-c[0];
				int z = x + y + t;
				r = z%10;
				t = z/10;
				s += c[r];
			}
			if (t) {
				for (int i=(int)s1.size(); i<(int)s2.size(); i++) {
					int z = s2[i]-c[0]+t;
					r = z%10;
					t = z/10;
					s += c[r];
				}
				if (t) s += c[t];
			} else {
				for (int i=(int)s1.size(); i<(int)s2.size(); i++) s += c[s2[i]-c[0]];
			}
		}
		
		if (s.size() > 80) cout << "overflow" << endl;
		else {
			reverse(s.begin(), s.end());
			cout << s << endl;
		}
	}
	
	return 0;
}

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

int main(){
    ios::sync_with_stdio(false);
    int n;
    for(cin>>n;n--;){
        int k=0;
        string a,b;
        cin >> a;
        cin >> b;
        if(a.size() < b.size()) swap(a,b);//????????????a>b?????????
        while(b.size() < a.size()) b = '0' + b;//????????????a==b?????????
        for(int i=a.size()-1;i>=0;i--){//???????????????????????????
            a[i] += b[i] - '0' + k;
            if(a[i] > '9'){
                a[i]-=10;
                k = 1;
            }
            else k = 0;
        }
        if(k)   a="1"+a;//??°??????????????????????????????????¶?????????¨???
        if(a.size() > 80)   cout << "overflow" << "\n";
        else    cout << a << "\n";
    }
    return 0;
}

C++: #include<iostream>
#include<cstring>
using namespace std;
int main(){
	int n;
	cin >>n;
	for(int i=0; i<n; i++){
		char num[2][90];
		int ans[90],up=0,t,l;
		cin >>num[0]>>num[1];
		int a = strlen(num[0]), b = strlen(num[1]), max = (b>a)? b:a, min = (b>a)? a:b;
		for(l=0; l<max; l++){
			if(l<min){t = (int)num[0][a-l-1]+(int)num[1][b-l-1]-48*2+up;}
			else if(a<b){t = (int)num[1][b-l-1]-48+up;}
			else{t = (int)num[0][a-l-1]-48+up;}
			if(t>9){t-=10;up = 1;}
			else{up = 0;}
			ans[l] = t;
		}
		if(up == 1){ans[max] = 1;l++;}
		if(l<=80)for(int m=l-1; m>=0; m--){cout <<ans[m];}
		else{cout<<"overflow";}
		cout <<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
	int d;
	for(cin>>d;d>0;d--){
		char ans[200];
		char n1[200];
		char n2[200];
		for(int i=0;i<=100;i++)ans[i]='0';
		scanf("%s",n1);
		scanf("%s",n2);
		int h1=strlen(n1)-1;
		int h2=strlen(n2)-1;
		int limit=max(h1,h2);
		int i;
		bool flg=false;
		for( i=0;i<=limit;i++,h1--,h2--){
			flg=false;
			int n1_tmp=0;
			int n2_tmp=0;
			if(h1>=0){
				n1_tmp=n1[h1]-'0';
			}
			if(h2>=0){
				n2_tmp=n2[h2]-'0';
			}
			int sum=n1_tmp+n2_tmp;
			if(sum>=10){
				ans[i+1]=ans[i+1]+1;
				sum=sum%10;
				flg=true;
			}
			ans[i]+=sum;
			if(ans[i]>'9'){
				ans[i]=ans[i]-(10);
				ans[i+1]+=1;
				flg=true;
			}
		}
		if(flg){
			i++;
		}
		ans[i]='\0';
		if(i>80)cout<<"overflow"<<endl;
		else{
			for(i--;i>=0;i--){
				cout<<ans[i];
			}
			cout<<endl;
		}
//		cout<<"size:"<<strlen(ans)<<endl;
	}
	return 0;
}

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

using namespace std;

void initiate(int* a)
{
	for (int j=0; j<100; j++) a[j] = 0;
}

int main()
{
	int a[101], b[101];
	char buf[101];
	
	int datasets;
	cin >> datasets;
	
	int len;
	
	for (int i=0; i<datasets; i++) {
		initiate(a); initiate(b);
		cin >> buf;
		len = strlen(buf);
		for (int j=0; j<len; j++) a[j] = static_cast<int>(buf[len-j-1] - 48);
		cin >> buf;
		len = strlen(buf);
		for (int j=0; j<len; j++) b[j] = static_cast<int>(buf[len-j-1] - 48);
		
		//test
		//for (int j=0; j<100; j++) cout << a[j];
		//cout << endl;
		//for (int j=0; j<100; j++) cout << b[j];
		//cout << endl;
		
		char carry = 0;
		for (int j=0; j<100; j++) {
			a[j] += b[j] + carry;
			carry = a[j] / 10;
			a[j] -= carry * 10;
		}
		
		bool nonzeroFlg = false;
		for (int j=99; j>=0; j--) {
			if (j>=80 && a[j]>0) {
				cout << "overflow";
				break;
			}
			if (a[j]>0) nonzeroFlg = true;
			if (nonzeroFlg) cout << a[j];
		}
		cout << endl;
	}
	
	return 0;
}