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

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

int stoi(char c){
	return c-'0';
}

char itos(int a){
	return a+'0';
}

int main(){
	int n;
	string s1,s2,ans;
	int lmin , lmax , sum , tmp , tmp2;
	bool bs1=true;
	cin >> n;
	for(int i=0; i<n ; ++i){
		cin >> s1 >> s2;
		reverse(s1.begin(),s1.end());
		reverse(s2.begin(),s2.end());
		lmin=min(s1.length(),s2.length());
		lmax=max(s1.length(),s2.length());
		if(s1.length()<s2.length()) bs1=false;
		for(int j=0;j<lmin;++j){
			ans.resize(j+2 , '0');
			sum=stoi(s1[j])+stoi(s2[j]);
			if(sum>=10){
				ans[j+1]=itos(1);
				tmp=stoi(ans[j]);
				tmp+=sum%10;
				ans[j]=itos(tmp);
			} else {
				int tmp=stoi(ans[j]);
				tmp+=sum;
				if(tmp>=10){
					ans[j+1]=itos(1);
					tmp2=stoi(ans[j]);
					tmp2=tmp%10;
					ans[j]=itos(tmp2);
				} else {
					ans[j]=itos(tmp);
				}
			}
			
		}
		for(int k=lmin; k<lmax ; ++k){
			ans.resize(k+2, '0');
			if(bs1){
				sum=stoi(ans[k])+stoi(s1[k]);
				if(sum>=10){
				ans[k+1]=itos(1); 
				tmp=sum%10;
				ans[k]=itos(tmp);
				} else {
					ans[k]=itos(sum);
				}
			} else {
				sum=stoi(s2[k]);
				sum+=stoi(ans[k]);
				if(sum>=10){
				ans[k+1]=itos(1);
				tmp=sum%10;
				ans[k]=itos(tmp);
				} else {
				ans[k]=itos(sum);
				}
			}
		}
		reverse(ans.begin(),ans.end());
		if(ans[0]=='0') ans.erase(0,1);
		if(ans.length()>80 || s1.length()>80 || s2.length()>80) {cout << "overflow" << endl; ans.clear();}
		else {
			cout << ans << endl;
			ans.clear();
		}
	}
	return 0; 
}

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

int main(){
	string s1, s2;
	int n, n1[100], n2[100];cin >> n;
	for(int g = 0;g < n;g++){
		cin >> s1 >> s2;
		for(int i = 0;i < 100;i++)n1[i] = n2[i] = 0;
		if(s1.size()>80 || s2.size()>80){
			cout << "overflow" << endl;
			continue;
		}
		for(int i = 0;i < s1.size();i++)n1[i] = s1[s1.size()-i-1] - '0';
		for(int i = 0;i < s2.size();i++)n2[i] = s2[s2.size()-i-1] - '0';
		
		for(int i = 0;i < 90;i++){
			n1[i] += n2[i];
			if(n1[i] > 9){n1[i] = n1[i]%10;n1[i+1]++;}
		}
		int flag = 0;
		for(int i = 90;i >= 0;i--){
			if(!flag && i == 0){cout << n1[0];break;}
			if(flag && i >= 80){flag = 2;break;}
			if(flag)cout << n1[i];
			if(!flag && i > 0 && n1[i-1] != 0)flag = 1;
		}
		if(flag == 2)cout << "overflow";
		cout << endl;
	}
	return 0; 
}

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

int main(int argc, const char * argv[]) {
    int a[80];
    int b[80];
    char temp[80];
    int x, y;
    int s[80];
    int a_num, b_num, n, i;

    scanf("%d", &y);
    for (i=0; i<y; i++) {
        for (n = 0; n < 80; n++) {
            a[n] = 0;
            b[n] = 0;
            s[n] = 0;
        }
        
        a_num = 0;
        scanf("%s", temp);
        a_num = (int)strlen(temp) - 1;
        for (n = 0; n <= a_num; n++){
            a[a_num - n] = temp[n] - 48;
        }

        b_num = 0;
        scanf("%s", temp);
        b_num = (int)strlen(temp) - 1;
        for (n = 0; n <= b_num; n++) {
            b[b_num - n] = temp[n] - 48;
        }
        
        if (a_num > 80 || b_num > 80) {
            printf("overflow\n");
        } else {
            if (a_num >= b_num) {
                for (n=0; n <= a_num; n++) {
                    x = a[n] + b[n] + s[n];
                    if (x > 9) {
                        s[n+1]++;
                        x = x - 10;
                    }
                    s[n] = x;
                }
                if (s[a_num+1] > 0) printf("%d", s[a_num+1]);
                for (n=a_num; n >= 0; n--) {
                    printf("%d", s[n]);
                }
                printf("\n");
            } else {
                for (n=0; n <= b_num; n++) {
                    if ((x = a[n] + b[n] + s[n]) > 9) {
                        s[n+1]++;
                        x = x - 10;
                    }
                    s[n] = x;
                }
                if (s[b_num+1] > 0) printf("%d", s[b_num+1]);
                for (n=b_num; n >= 0; n--) {
                    printf("%d", s[n]);
                }
                printf("\n");
            }
        }
    }
    return 0;
}

C++: #include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
const int DIGIT=9;

int main() {
  int n;
  char buf[81];
  int l, x[2], y, z;
  char buf_part[DIGIT+1];
  int a[2][9];
  int b[9];

  cin >> n;
  while (n--) {
    for (int i=0; i<2; i++) {
      cin >> buf;
      l = strlen(buf);
      x[i] = (l+DIGIT-1)/DIGIT;
      y = (l-1)%DIGIT+1;
      for (int j=0; j<9; j++) {
        a[i][j] = 0;
      }
      for (int j=0; j<x[i]; j++) {
        if (!j) {
          memcpy(buf_part, buf, y);
          buf_part[y] = '\0';
        } else {
          memcpy(buf_part, &buf[y+DIGIT*(j-1)], DIGIT);
          buf_part[DIGIT] = '\0';
        }
        a[i][x[i]-j-1] = atoi(buf_part);
      }
    }

    /*for (int i=0; i<9; i++) b[i] = 0;
    z = (x[0] > x[1]) ? x[0] : x[1];
    for (int i=0; i<z; i++) {
      b[i] = a[0][i] + a[1][i];
      if (b[i] >= 1000000000) {
        a[0][i+1]++;
        b[i] -= 1000000000;
      }
    }
    if (z<9 && a[0][z]) {
      b[z] = a[0][z]+a[1][z];
      ++z;
    }
    if (b[8] >= 100000000) {
      cout << "overflow" << endl;
    } else {
      cout << b[z-1];
      for (int i=z-2; i>=0; i--) {
        cout.fill('0');
        cout.width(DIGIT);
        cout << b[i];
      }
      cout << endl;
    }*/
  }
  return 0;
}

C++: #include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<string>
#include<iostream>
using namespace std;
int chrtoint(char a){
int i;
i=a-48;
 return i;
return 0;
}

int main(){
char n1[1000];
char n2[1000];
int rs[1000];
int c1, c2;

int i,j,m, cmax, sum,testcase;
scanf("%d",&testcase);
while(testcase--){
scanf("%s", &n1);
scanf("%s", &n2);
c1 = strlen(n1);
c2 = strlen(n2);

reverse(n1,n1+c1);
reverse(n2,n2+c2);

cmax = c1;
if(c1<c2){
cmax = c2;
}

m=0;
for(i=0; i< cmax; i++){
if(c1==c2 || (i < c1 && i < c2)){
sum = m+chrtoint(n1[i])+chrtoint(n2[i]);
}else if(i >=c1){
sum = m+chrtoint(n2[i]);
}else if(i >=c2){
sum = m+chrtoint(n1[i]);
}
if(sum>9){
m = 1;
rs[i] = sum-10;
}
else{
m=0;
rs[i] = sum;
}
}

if(m){
rs[i]=m;
i++;
}
if(i>80){
    printf("overflow\n");
    continue;
}
for(j=0; j < i; j++){
printf("%d", rs[i-j-1]);
}
}
return 0;
}