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<string>
#include<iostream>
#include<algorithm>
#include<cstring>

using namespace std;
string a,b,sum;
void check(int z,int x);
int A,B;
int main(void){

    int n;
    cin>>n;
    while(n--){
        a="",b="",sum="";

        cin>>a>>b;
        //cout<<"a="<<a<<"b="<<b<<"sum="<<sum<<endl;
        if(a.length()>80||b.length()>80){
            sum="overflow";
            goto end;
        }
        A=a.length(),B=b.length();
        //cout<<A<<B<<endl;
        reverse(a.begin(),a.end());
        reverse(b.begin(),b.end());
        if(A<B)swap(A,B),swap(a,b);
        for(int i=0;i<=A-B;i++){
            b+="0";
        }
        check(0,0);
        //cout<<sum<<endl;
        if(sum.length()>80){
            sum="overflow";
            goto end;
        }
        reverse(sum.begin(),sum.end());
        end:;
        cout<<sum<<endl;
    }
    return 0;
}

void check(int z,int x){
    int i;


    if(a[z]==0)a[z]='0';
    if(b[z]==0)b[z]='0';
    //cout<<a[z]<<"."<<b[z]<<"."<<sum<<endl;
    //cout<<"--"<<z<<endl;
    if(z==80||(z>A&&z>B&&x==1)||(z>=A&&z>=B&&x==0)){
            x=0;
            return;
    }
    i=(int)a[z]-'0' + (int)b[z]-'0' + x,x=0;
    //cout<<"*"<<i<<endl;
    //cout<<"-"<<z<<endl;
    if(i>=10)x=1,i-=10;
    sum+=i+'0';
    //cout<<"+"<<sum<<endl;

    check(z+1,x);

}

C++: #include<bits/stdc++.h>
using namespace std;

struct Integer{
    int num[100];
    Integer(const char *s){
        fill_n(num,100,0);
        int l=strlen(s);
        for(int i=0;i<l;i++){
            num[l-i-1]=s[i]-'0';
        }
    }
};
const Integer operator+(const Integer &lint,const Integer &rint){
    Integer ret("");
    for(int i=0;i<100;i++){
        int v=ret.num[i]+lint.num[i]+rint.num[i];
        ret.num[i]=v%10;
        if(i+1>=100)continue;
        ret.num[i+1]+=v/10;

    }
    return ret;
}

char a[200],b[200];
int main(){
    int n;
    scanf("%d",&n);
    while(n--){
        scanf("%s%s",a,b);
        Integer ans=Integer(a)+Integer(b);
        int s=0;
        for(int i=0;i<100;i++)if(ans.num[i])s=i;
        if(s-1>=80){
            puts("overflow");
            continue;
        }
        for(int i=s;i>=0;i--)printf("%d",ans.num[i]);
        puts("");
    }
    return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include <utility>
using namespace std;
using namespace std;
int main(){
	
	int m;
	char in[2][100];
	char ans[100];
	int ie[2];
	int ien[2];
	bool max10;
	int Min;
	bool NMin;
	scanf("%d",&m);
	for(;m--;){
		
		for(int i=0;i<2;i++){
			scanf(" %s",&in[i]);
		}
		for(int i=0;i<2;i++){
			for(ie[i]=0;in[i][ie[i]]!='\0';ie[i]++){
			}
		}
		ie[0]--;
		ie[1]--;
		Min=max(ie[0],ie[1]);
		if((Min>79)||((Min>78)&&(ie[0]==ie[1])&&((int(in[0][0])+int(in[1][0]))>9))){
			cout<<"overflow"<<endl;
		}else{	
			if(ie[0]>ie[1]){
				NMin=0;
			}else{
				NMin=1;
			}
			ien[0]=ie[0];
			ien[1]=ie[1];
			for(;min(ien[0],ien[1])+1;ien[0]--,ien[1]--){
				in[NMin][ien[NMin]]=in[0][ien[0]]+in[1][ien[1]]-'0';
				if(in[NMin][ien[NMin]]>9+'0'){
					in[NMin][ien[NMin]]-=10;
					in[NMin][ien[NMin]-1]  +=1;
				}
			}
			max10=0;
			for(;ien[NMin]>-1;ien[NMin]--){
				if(in[NMin][ien[NMin]]>9+'0'){
					in[NMin][ien[NMin]]-=10;
					if(ien[NMin]!=0){
						in[NMin][ien[NMin]-1]+=1;
					}else{
						max10=1;
					}
				}
			}
			
			
			if(max10) cout<<"1";
			cout<<in[NMin]<<endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<cstring>
using namespace std;
#define MAX 1000
#define temp 85
int main(){
	int x,A[MAX],B[MAX],al,bl,sum[MAX],pre,now;
	char a[MAX],b[MAX];
	cin>>x;
	while(x-->0){
		for(int i=0;i<MAX;i++){
			A[i]=0;
			B[i]=0;
			sum[i]=0;
		}
		cin>>a;
		cin>>b;
		al=strlen(a);
		bl=strlen(b);
		for(int i=0;i<al;i++)
		A[i]=a[al-1-i]-'0';
		for(int i=0;i<bl;i++)
		B[i]=b[bl-1-i]-'0';
		if(al>bl)
		bl=al;
		pre=0;
		for(int i=0;i<=bl;i++){
			if(A[i]+B[i]+pre>9)
				now=1;
			else now=0;
			sum[i]=(A[i]+B[i]+pre)%10;
			pre=now;
		}
		if(sum[bl]!=0){
			if(bl>=80){
				cout<<"overflow"<<endl;
				continue;
			}
		for(int i=bl;i>=0;i--)
		cout<<sum[i];
		}
		else {
			if(bl-1>=80){
				cout<<"overflow"<<endl;;
				continue;
			}
		for(int i=bl-1;i>=0;i--)
		cout<<sum[i];
		}
		cout<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#define max(a,b) a>b?a:b
using namespace std;
int che(char a){
	char i;
	int j=0;
	for(i='0';i<='9';i++){
		if(a==i){
			return j;
		}
		j++;
	}
	return 0;
}
char cha(int a){
	char i;
	int j=0;
	for(i='0';i<='9';i++){
		if(j==a){
			return i;
		}
		j++;
	}
}
int main(){
	string a,b;
	int c=0;
	int i,j,k,m,n;
	int x,y;
	char d[200];
	cin>>n;
	for(k=0;k<n;k++){
		cin>>a>>b;
		x=a.size();
		y=b.size();
		m=max(x,y);
		for(i=1;i<=m;i++){
			j=che(a[x-i])+che(b[y-i])+c;
			if(j>=10){
				c=1;
				j-=10;
			}else{
				c=0;
			}
			d[i]=cha(j);
		}
		if(c==1){
			d[i]=cha(1);
			c=0;
			i++;
		}
		if(i>81){
			cout<<"overflow"<<endl;
			continue;
		}
		for(j=i-1;j>0;j--){
			cout<<d[j];
		}
		cout<<endl;
	}
	return 0;
}

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

using namespace std;
void add(string& ans,string& a,string& b);
int main() {
	string a,b;
	int al,bl;
	int n;
	cin>>n;
	while(n--){
	        string ans="";
		cin>>a>>b;
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());
		al=a.size();
		bl=b.size();
		if(bl>al){
			swap(a,b);
			swap(al,bl);
		}
		for(int i=bl;i<al;i++){
			b[i]='0';
		}
		add(ans,a,b);
		if(ans.size()>80){
		  printf("overflow\n");
		}else{
		  reverse(ans.begin(),ans.end());
		  cout<<ans<<endl;
		}
	  	
	}
	return 0;
}
void add(string& ans,string& a,string& b){
	int x,y=0;
	int i;
	int al=a.size();
	for(i=0;i<al;i++){
		x=a[i]-'0'+b[i]-'0';
		if((x+y)>=10){
		        ans[i]= ((x+y)%10)+'0';
			y=1;
		}else{
		        ans[i]= (x+y)+'0';
			y=0;
		}
	}
	if(y==1)ans[i]='1';
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int mx;
void solve(vector<int> a,vector<int> b)
{
  vector<int>ans;
  int t = 0;
  for(int i = 0 ; i < mx ; i++ )
    {
      ans.push_back((a[i] + b[i] + t)%10);
      if(a[i] + b[i] + t >= 10)t = 1;
      else t = 0;
    }
  if(t == 1)ans.push_back(1);
  for(int i = ans.size()-1 ; i >= 0 ; i-- ){
    cout << ans[i];
  } 
  cout << endl;
}

int main(){
  int n;
  vector<int>ve1,ve2;
  cin >> n;
  while(n--){
    ve1.clear(),ve2.clear();
    string a,b;
    cin >> a >> b;
    mx = max(a.size(),b.size());
    for(int i = a.size()-1,j = 0 ; j < mx ; i--,j++ ){
      if(i < 0 )ve1.push_back(0);
      else ve1.push_back(a[i]-'0');
    }
    for(int i = b.size()-1,j = 0 ; j < mx ; i--,j++ ){
      if(i < 0 )ve2.push_back(0);
      else ve2.push_back(b[i]-'0');
    } 
    solve(ve1,ve2);
  }
  return 0;
}