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 <vector>

using namespace std;

int main(int argc, char *argv[]) {
  int n;
  vector<string> result;
  string a, b;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    if (a.size() > 80 || b.size() > 80) {
      result.push_back("overflow");
      continue;
    }

    int carry = 0;
    if (a.size() < b.size())
      a.swap(b);
    string::reverse_iterator ria = a.rbegin();
    string::reverse_iterator rib = b.rbegin();

    while (true) {
      if (*ria - '0' + *rib - '0' + carry >= 10) {
        *ria += *rib + carry - '0' - 10;
        carry = 1;
      } else {
        *ria += *rib + carry - '0';
        carry = 0;
      }
      ria++;
      rib++;
      if (rib == b.rend())
        break;
    }
    /*                                                                                                                                                                                                                                                         
    cout << a << endl;                                                                                                                                                                                                                                         
    cout << carry << endl;                                                                                                                                                                                                                                     
    */
    while (true) {
      if (carry && ria == a.rend())
        a.insert(0, "1");
      else if (carry)
        if (*ria - '0' + 1 >= 10) {
          *ria += carry - 10;
          carry = 1;
        } else {
          *ria += 1;
          carry = 0;
          break;
        }
      else
        break;
      ria++;
    }
    if (a.size() > 80)
      result.push_back("overflow");
    else
      result.push_back(a);
  }

  for (int i = 0; i < result.size(); i++)
    cout << result[i] << endl;
  return 0;
}

C++: #include <cstdio>
#include <cstring>
char A[81],B[81],C[83];
int main() {
	int N,Alen,Blen;
	scanf("%d",&N);
	for(int i=0;i<N;i++) {
		scanf("%s",A);
		scanf("%s",B);
		Alen=strlen(A);
		Blen=strlen(B);
		memset(C,-1,sizeof(C));
		for(int j=Alen-1,k=0;j>=0;j--,k++) {
			C[k]=A[j]-'0';
		}
		for(int j=Blen-1,k=0;j>=0;j--,k++) {
			C[k]+=B[j]-'0';
		}
		for(int j=0;C[j]!=-1;j++) {
			if(C[j]/10) {
				if(C[j+1]!=-1)C[j+1]+=C[j]/10;
				else C[j+1]=C[j]/10;
			}
			C[j]%=10;
		}
		for(int j=82;j>=0;j--) {
			if(C[j]!=-1)putchar('0'+C[j]);
		}
		putchar('\n');
	}
}

C++: #include <iterator>
#include <typeinfo>
#include <list>
#include <map>     
#include <numeric>
#include <utility>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <iostream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define rep(a,t) for(int a=0;a<t;++a) 
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
#define pb push_back
#define int_maxvalue numeric_limits<int>::max()
ll mod = 1e9 + 7;
string Addition(string a,string b) {
	string ans = "";
	int bef = 0;
	int be1 = 0;
	for (int i = a.length() - 1; i >= 0; i--) {
		int added = stoi(a.substr(i, 1)) + stoi(b.substr(i, 1))+be1;

		if (added >= 10) {
			bef = 1;
			added -= 10;
		}
		else {
			bef = 0;
		}
		stringstream ss;
		ss << added;

		ans = ss.str()+ans;
		if (i == 0) 
		{
			break;
		}
		be1 = bef;
	}
	if (be1 == 1) {
		ans = "1" + ans;
	}
	return ans;
}
int main() {
	int n;
	cin >> n;
	rep(o1, n) {
		string a, b;
		cin >> a >> b;
		if (a.length() < b.length()) {
			swap(a, b);
		}
		string b1 = b;
		for (int i = 0; i < a.length() - b1.length(); ++i) {
			b = '0' + b;
		}
		string ans = Addition(a, b);
		if (ans.length() > 80) { cout << "overflow" << endl; }
		else {
			cout << ans << endl;
		}
	}
	return 0;
}

C++: #include<cstdio>

int main(){
	int a[82] = {};
	int b[82] = {};
	int c[82] = {};
	int n;
	int k,l,m,f;
	char t;
	int of;

	scanf("%d\n", &n);

	for(int i = 0; i < n; i++){
		of = k = l = 0;
		scanf("%c", &t);
		while(t - 10){
			k++;
			a[k] = t - '0';
			scanf("%c", &t);
			if(k == 81){
				of = 1;
				while(t - 10){
					scanf("%c", &t);
				}
			}
		}
		scanf("%c", &t); 

		while(t - 10){
			l++;
			b[l] = t - '0';
			scanf("%c", &t);
			if(l == 81){
				of = 1;
				while(t - 10){
					scanf("%c", &t);
				}
			}

		}

		m = 0;
		f = 0;

		while(k - m){
			c[m] = a[k - m];
			m++;
		}
		m = 0;
		while(l - m){
			c[m] += b[l - m ] + f;
			f = 0;
			if(c[m] > 9){
				c[m] -= 10;
				f = 1;
			}
			m++;
		}

		while(f){
			c[m] += 1;
			f = 0;
			if(c[m] > 9){
				c[m] -= 10;
				f = 1;
			}
			m++;
		}

		if(k > m){
			m = k;
		}

		for(int i = 0; i < m; i++){
			if(m == 81 || of){
				printf("overflow");
				f = 1;
				i = m;
			}else{
				if((c[m - i -1]) || f){
					printf("%d", c[m - i - 1]);
					f = 1;
				}
			}
		}
		if(f - 1){
			printf("0");
		}
		printf("\n");
	}
	return 0;
}

C++: #include<iostream>
#include<cstring>
#include<cstdlib>
#include<cstdio>
using namespace std;

int main()
{
    int N,j,k=-1;
    cin >> N;
    char strA[100],strB[100];
    while(cin >> strA >> strB){
        k++;
        if(k==N){
            break;
        }
        int ans[81]={0};
        ans[0]=11111;
        if(strlen(strA)>80||strlen(strB)>80){
            cout << "overflow" << endl;
            continue;
        }
        char str1[strlen(strA)][2],str2[strlen(strB)][2];
        for(int i=0 ; i<strlen(strA) ; i++){
            str1[i][0]=strA[i];
            str1[i][1]='\0';
        }
        for(int i=0 ; i<strlen(strB) ; i++){
            str2[i][0]=strB[i];
            str2[i][1]='\0';
        }
        int a[81]={0},b[81]={0};
        j=strlen(strA)-1;
        for(int i=80 ; j>=0 ; i--){
            a[i]=atoi(str1[j]);
            j--;
        }
        j=strlen(strB)-1;
        for(int i=80 ; j>=0 ; i--){
            b[i]=atoi(str2[j]);
            j--;
        }
        for(int i=80 ; i!=0 ; i--){
            ans[i]=ans[i]+a[i]+b[i];
            if(ans[i]>=10){
                ans[i]=ans[i]-10;
                ans[i-1]++;
            }
        }
        if(ans[0]!=11111){
            cout << "overflow" << endl;
            continue;
        }
        for(int i=1 ; i<81 ; i++){
            if(ans[i]!=0){
                j=i;
                break;
            }
        }
        char c[3];
        for(int i=j ; i<81 ; i++){
            printf("%c",ans[i]+48);
        }
        cout << '\n';
    }
    return 0;
}