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<stdio.h>
#include<string>
#include<algorithm>
using namespace std;
int max(int a,int b){return a>b?a:b;}
int main(){
	int n;
	scanf("%d",&n);
	for(int d=0;d<n;d++){
		char a[100];
		char b[100];
		scanf(" %s",a);
		scanf(" %s",b);
		string s,t;
		int i=0;
		s.append(a);
		t.append(b);
		reverse(s.begin(),s.end());
		reverse(t.begin(),t.end());
		string ans;
		int k=0;
		for(i=0;i<max(s.size(),t.size())+1;i++){
			int x,y;
			if(i>=s.size())x=0;
			else x=s[i]-'0';
			if(i>=t.size())y=0;
			else y=t[i]-'0';
			int z=x+y+k;
			k=z/10;
			char c=z%10+'0';
			if(i!=max(s.size(),t.size())||c!='0')ans.append(1,c);
		}
		reverse(ans.begin(),ans.end());
		if(ans.size()>=81)printf("overflow\n");
		else printf("%s\n",ans.c_str());
	}
	return 0;
}

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

int main(){
	int n, len, car;
	string a, b, ans;
	cin >> n;
	for(int i = 0;i < n;++i){
		car = 0;
		ans = "";
		cin >> a >> b;
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());
		len = max(a.length(), b.length());
		for(int i = 0;i < len;++i){
			int x, y, s;
			x = i < a.length() ? a[i] - '0' : 0;
			y = i < b.length() ? b[i] - '0' : 0;
			s = x + y + car;
			car = s / 10;
			ans += (s % 10 + '0');
		}
		if(car != 0) ans += (car + '0');
		if(ans.length() <= 80){
			reverse(ans.begin(), ans.end());
			cout << ans << endl;
		}
		else{
			cout << "overflow" << endl;
		}
	}
	return 0;
}

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

int main(){
	int n, max;
	cin >> n;
	for (int z = 0; z < n;z++) {
		string x, xx, y, yy, outp;
		cin >> x >> y;
		if (cin.eof()) { break; }
		int lengx = x.size();
		int lengy = y.size();
		
		if (lengx > 80 || lengy > 80) {
			cout << "overflow" << endl;
			continue;
		}
		
		if (lengx < lengy){
			max = lengy;
		}
		else{
			max = lengx;
		}

		int m[81], n[81], wa[81];
		for(int i=0;i<81;i++){
			m[i] = 0;
			n[i] = 0;
			wa[i] = 0;
		}

		for (int i = 0; i<lengx; i++) {
			xx = x[lengx - i - 1];
			m[i] = stoi(xx);
		}
		for (int i = 0; i<lengy; i++) {
			yy = y[lengy - i - 1];
			n[i] = stoi(yy);
		}

		for(int i = 0; i < max; i++){
			wa[i] += n[i];
			wa[i] += m[i];

			if (wa[i]>=10){
				wa[i] -= 10;
				wa[i + 1] += 1;
			}

		}
		if(wa[80] == 1){
			cout << "overflow" << endl;
			continue;
		}

		int c = max;
		if(wa[max] == 1){
			c += 1;
		}

		for(int i=0;i<c;i++){
			outp += to_string(wa[c - i -1]);
		}
		cout << outp << endl;
	}
	return 0;
}

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

using namespace std;

int main(){
    
    string d;
    string e;
    
    
    int n=0;
    scanf("%d",&n);
    
    for(int i=0; i<n; i++){
        int f[81]={0};
        int g[81]={0};
        int h[81]={0};
        
        cin>>d;
        cin>>e;
        
        if((int)d.length()>80||(int)e.length()>80){
            printf("overflow\n");
        }else{
            int j=80;
            for(int i=(int)d.length()-1; i>=0; i--){
                f[j] = (d[i]-'0');
                j--;
            }
            j=80;
            for(int i=(int)e.length()-1; i>=0; i--){
                g[j] = (e[i]-'0');
                j--;
            }
            
//            for(int i=0; i<81; i++){
//                printf("%d",f[i]);
//            }
//            printf("\n");
//            
//            for(int i=0; i<81; i++){
//                printf("%d",g[i]);
//            }
//            printf("\n");
            
            int temp=0;

            for(int i=80; i>=0; i--){
                temp = temp + f[i] + g[i];
                h[i] = temp % 10;
                temp = temp / 10;
            }
            j=0;
            if(h[j]!=0){
                printf("overflow\n");
            }else{
                while(h[j]==0){
                    j++;
                }
                if(j==165){
                    printf("0");
                }else{
                    for(int i=j; i<81; i++){
                        printf("%d",h[i]);
                    }
                }
            }
            printf("\n");
        }
        
        
        
    }
return 0;
    
    
}

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

int main(){
  int j;
  char s1[111] = {0};
  char tmp[111] = {0};
  char s2[111] = {0};
  char ans[111];
  int  kuri = 0 ;
  memset(ans,0,sizeof(ans));
  cin >> s1 >> s2;
  if(strlen(s1) < strlen(s2)){
      for(int i=0,j=strlen(s1)-1;i<=j;i++,j--) swap(s1[i],s1[j]);
      for(int i=0,j=strlen(s2)-1;i<=j;i++,j--) swap(s2[i],s2[j]);
      for(int i=0;i<strlen(s2);i++){
	if((s2[i] + (s1[i]%'0') + kuri) > '9'){
	  ans[i] = (s2[i] + (s1[i]%'0') + kuri)-10;
	  kuri = 1;
	}
	else {
	  ans[i] = (s2[i] + (s1[i]%'0') + kuri);
	  kuri = 0;
	}
	if(i == strlen(s2)-1 && kuri == 1) ans[i+1] = '1';
      }
      for(int i=strlen(ans)-1;i>=0;i--) cout << ans[i];
  }
  else{
    for(int i=0,j=strlen(s1)-1;i<=j;i++,j--) swap(s1[i],s1[j]);
    for(int i=0,j=strlen(s2)-1;i<=j;i++,j--) swap(s2[i],s2[j]);
    for(int i=0;i<strlen(s1);i++){
      if((s1[i] + (s2[i]%'0') + kuri) > '9'){
	ans[i] = (s1[i] + (s2[i]%'0') + kuri)-10;
	kuri = 1;
      }
      else {
	ans[i] = (s1[i] + (s2[i]%'0') + kuri);
	kuri = 0;
      }
      if(i == strlen(s1)-1 && kuri == 1) ans[i+1] = '1';
    }
    for(int i=strlen(ans)-1;i>=0;i--) cout << ans[i];
  }
  cout << endl;
}

C++: #include <iostream>
#include <stdio.h>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <set>
#include <math.h>
#include <utility>
#include <stack>
using namespace std;
typedef pair<int,int> P;
const int INF = ~(1<<31) / 2;

int main(){
    int k;
    cin >> k;
    for(int j=0;j<k;j++){
        int n[80];
        string a,b;
        cin >> a >> b;
        int n_a = a.size(),n_b = b.size();
        if(n_a>80||n_b>80){cout << "overflow" << endl;continue;}

        fill(n,n+80,0);
        bool is_over = false;
        for(int i=0;i<max(n_a,n_b);i++){
            int ai,bi;
            if (i<n_a) ai = a[n_a-i-1]-'0';
            else ai = 0;
            if (i<n_b) bi = b[n_b-i-1]-'0';
            else bi = 0;
            n[i] += ai + bi;
            if (n[i]>=10){
                if(i+1 == 80){
                    is_over = true;
                    break;
                }else{
                    n[i+1] += n[i]/10;
                    n[i] = n[i]%10;
                }
            }
        }
        if (is_over){
            cout << "overflow" << endl;
        }else{
            bool started = false;
            for(int i=79;i>=0;i--){
                if(!started && n[i]>0){
                    started = true;
                }
                if(started){
                    cout << n[i];
                }
            }
            cout << endl;
        }
    }
    return 0;
}