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 <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string.h>
#include <queue>
#include <stack>
#include <utility>
#include <queue>
#define mp make_pair
#define pii pair<int,int> 
#define ff first
#define ss second

using namespace std;

int t,temp1,temp2,tempc;
char a[1000],b[1000];
char temp[1000];
int c[1000];

int addition(int n1,int n2)
{
	//printf("%d,%d ",n1,n2);
	if(n1>=n2)
	{
		if(n2!=-1)
		{
			temp1=(int)a[n1]-48;
			temp2=(int)b[n2]-48;
			tempc=temp1+temp2;
			//printf("%d,%d,%d",temp1,temp2,tempc);
			if(tempc+c[n1+1]>=10)
			{
				tempc-=10;
				c[n1]+=1;
			}
			c[n1+1]+=tempc;
			//printf("%d,%d",c[n1+1],tempc);
			addition(n1-1,n2-1);
		}
		else if(n1!=-1)
		{
			tempc=(int)a[n1]-48;
			if(tempc+c[n1+1]>=10)
			{
				c[n1+1]-=10;
				c[n1]+=1;
			}
			c[n1+1]+=tempc;
			addition(n1-1,n2);
		}
	}
	else
	{
		for(int x=0;x<max(strlen(a),strlen(b))+5;x++)
		{
			temp[x]=a[x];
			a[x]=b[x];
			b[x]=temp[x];
		}
		addition(n2,n1);
	}
}

int main()
{
	scanf("%d",&t);
	while(t--)
	{
		scanf("%s",a);
		scanf("%s",b);
		for(int x=0;x<max(strlen(a),strlen(b))+5;x++)
		{
			c[x]=0;
		}
		if(strlen(a)>80||strlen(b)>80)
		{
			printf("overflow\n");
			continue;
		}
		else
		{
			addition(strlen(a)-1,strlen(b)-1);
			//printf("%d",(int)a[1]);
			//printf("%d,%d\n",strlen(a),strlen(b));
		}
		if(c[0]>0&&max(strlen(a),strlen(b))>=80)
		{
			printf("overflow\n");
		}
		else
		{
			for(int z=0;z<max(strlen(a),strlen(b))+1;z++)
			{
				if(c[z]==0&&z==0)
				continue;
				printf("%d",c[z]);
			}
			printf("\n");
		}
	}
	return 0;
}

C++: #include <stdio.h>
#include <string.h>
 
int main(void) {
    char a[200],b[200],result[200],temp[200];
    int ketaagari;
    int i,j;
    int max;
    char in;
    int overflow;
    int count,kazu;
    scanf("%d",&kazu);
    for(count=0;count<kazu;count++) {
        for(i=0;i<200;i++) {
            a[i]=0;b[i]=0;
        }
        i=0;
        overflow=0;
    	
    	scanf(" %s ",temp);
    	i=strlen(temp);
    	if(i>80)overflow=1;
        else for(j=0;j<i;j++)a[j]=temp[i-j-1]-'0';
    	
    	scanf(" %s ",temp);
    	i=strlen(temp);
    	if(i>80)overflow=1;
    	else for(j=0;j<i;j++)b[j]=temp[i-j-1]-'0';
 
        for(i=0,ketaagari=0,max=0;i<80;i++) {
            result[i]=(a[i]+b[i]+ketaagari)%10;
            ketaagari=(a[i]+b[i]+ketaagari)/10;
            if(result[i]!=0)max=i;
        }
        if(ketaagari)overflow=1;

    	if(overflow==0) {
            for(i=max;i>=0;i--)printf("%d",result[i]);
            printf("\n");
        } else printf("overflow\n");
    }
    return 0;
}

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

using namespace std;

void reverse(string *s){
	for(int i=0;i<s->length()/2;i++){
		char tmp=s->at(i);
		s->at(i)=s->at(s->length()-i-1);
		s->at(s->length()-i-1)=tmp;
	}
}

int main(void){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		string s1,s2;
		cin>>s1;
		cin>>s2;
		if(s1.length()>80||s2.length()>80){
			cout<<"overflow"<<endl;
		}else{
			string s3;
			string tmp;
			if(s1.length()<s2.length()){
				tmp=s1;
				s1=s2;
				s2=tmp;
			}
			int c=0;
			for(int j=0;j<s1.length();j++){
				int tmp;
				if(j<s2.length()){
					tmp=s1[s1.length()-j-1]-'0'+s2[s2.length()-j-1]-'0'+c;
				}else{
					tmp=s1[s1.length()-j-1]-'0'+c;
				}
				c=tmp/10;
				s3.append(1,tmp%10+'0');
			}
			if(c!=0){
				s3.append(1,'1');
			}
			if(s3.length()>80){
				cout<<"overflow"<<endl;
			}else{
				reverse(&s3);
				cout<<s3<<endl;
			}
		}
	}
}

C++:  #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 
 using namespace std;
 
 int main()
 {
   int N;
   cin>>N;
   while(N--)
   {
     string a,b,sum;
     cin>>a>>b;
     bool flag=false;
     if(a.length()>80||b.length()>80) flag=true;
     else
     {
       int up=0;
       int i;
       for(int j=0;j<a.length()/2;j++) swap(a[j],a[a.length()-j-1]);
       for(int j=0;j<b.length()/2;j++) swap(b[j],b[b.length()-j-1]);
       for(i=0;i<a.length()&&i<b.length();i++)
       {
         sum+=(((a[i]-'0')+(b[i]-'0')+up)%10)+'0'; 
         if(a[i]-'0'+b[i]-'0'+up>=10) up=1;   
         else up=0;  
       }          
       while(i<a.length()) 
       {
         sum+=((a[i]-'0'+up)%10)+'0';
         if(a[i]-'0'+up>=10) up=1; 
         else up=0;         
         i++;          
       }
       while(i<b.length()) 
       {
         sum+=((b[i]-'0'+up)%10)+'0';
         if(b[i]-'0'+up>=10) up=1; 
         else up=0;
         i++;                   
       }
       if(up==1) sum+='1';
       if(sum.length()>80) flag=true;
     }
     if(flag) cout<<"overflow"<<endl;
     else
     {
       for(int i=sum.length()-1;i>=0;i--) cout<<sum[i];
       cout<<endl;    
     }
   }
   //while(1);      
   return 0;    
 }

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

char iota(int n){
  switch (n) {
    case 0: return '0';
    case 1: return '1';
    case 2: return '2';
    case 3: return '3';
    case 4: return '4';
    case 5: return '5';
    case 6: return '6';
    case 7: return '7';
    case 8: return '8';
    case 9: return '9';
  }
  return '0';
}

int main(){

  std::string num1;   //("10000");
  std::string num2;   //("990000");
  char sum[100]={};
  int n,i,j,flag=0,temp;

  std::cin >> n;
  //n=1;
  for(i=0;i<100;i++){
    sum[i]='\0';
  }

  for(i=0;i<n;i++){
    std::cin >> num1 >> num2;
    if(num1.size()<num2.size()){
      num1.swap(num2);
    }
    //std::cout << num1 << std::endl;
    //std::cout << num2 << std::endl;
    for(j=0;j<num1.size();j++){
      if(j<num2.size()){
        temp = (num1[num1.size()-j-1]-'0')+(num2[num2.size()-j-1]-'0');
      }
      if(j>=num2.size()){
        temp = num1[num1.size()-j-1]-'0';
      }
      if(flag){
      ++temp;
      flag = 0;
      }
      if(temp>9){
        temp -= 10;
        flag = 1;
      }
      sum[j] = iota(temp);
    }
    if(flag){
      sum[j] = '1';
      flag = 0;
    }
    //printf("%s\n",sum);
    j=0;
    while(sum[j]!='\0'){
      ++j;
    }
    if(j>80){
      std::cout << "overflow" << std::endl;
    }else{
      while(j>0){
        std::cout << sum[j-1];
        --j;
      }
      std::cout << std::endl;
    }
  }
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#define SIZE 80
int main()
{
	int N, n, s;
	std::string d1, d2, sum;

	std::cin >> N;
	std::getline(std::cin, d1);
	for (n = 0; n < N; n ++) {
		std::getline(std::cin, d1);
		std::getline(std::cin, d2);
		if (d1.size() > SIZE || d2.size() > SIZE) {
			std::cout << "overflow" << std::endl;
		} else {
			std::reverse(d1.begin(), d1.end());
			std::reverse(d2.begin(), d2.end());
			s = 0;
			sum.clear();
			for (size_t i = 0; i < d1.size() || i < d2.size(); i ++) {
				s += (i < d1.size()) ? (d1[i] - '0') : 0;
				s += (i < d2.size()) ? (d2[i] - '0') : 0;
				sum += '0' + (s%10);
				s /= 10;
			}
			if (s)
				sum += '0' + s;
			if (sum.size() > SIZE) {
				std::cout << "overflow" << std::endl;
			} else {
				std::reverse(sum.begin(), sum.end());
				std::cout << sum << std::endl;
			}
		}
	}
	return 0;
}