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++: #define scanf_s scanf
#define sscanf_s sscanf
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 81
#define _MAX 100
//#define CONSTNUM 10000000
int main(void)
{
	int n, s = 0, x, y, r = 0, a, b;
	int sum_n[50][3] = { 0 };
	char sum[50][_MAX], astr[_MAX], bstr[_MAX], num[11] = { "0123456789" };
	char ca, cb;
	scanf_s("%d", &n);
	for (int i = 0; i < n; ++i) {
		scanf_s("%s %s", &astr, &bstr);
		for (x = 0; astr[x] != '\0'; ++x);
		for (y = 0; bstr[y] != '\0'; ++y);
		if (x > 80 || y > 80) {
			printf("overflow\n");
			continue;
		}
		for (int j = 0; j < x || j < y; ++j) {
			if (j < x && j < y) {
				ca = astr[x - j - 1]; cb = bstr[y - j - 1];
				sscanf_s(&ca, "%d", &a);
				sscanf_s(&cb, "%d", &b);
				if (x > y) sum[i][x - j] = num[(a + b + r) % 10];
				else sum[i][y - j] = num[(a + b + r) % 10];
				if (a + b + r >= 10) r = (a + b + r) / 10;
				else r = 0;
			}
			else {
				if (x > y) {
					if (r != 0) {
						ca = astr[x - j - 1];
						sscanf_s(&ca, "%d", &a);
						sum[i][x - j] = num[(a + r) % 10];
						if (a + r >= 10) r = (a + r) / 10;
						else r = 0;
					}
					else {
						sum[i][x - j] = astr[x - j - 1];
					}
				}
				else {
					if (r != 0) {
						cb = bstr[y - j - 1];
						sscanf_s(&cb, "%d", &b);
						sum[i][y - j] = num[(b + r) % 10];
						if (b + r >= 10) r = (b + r) / 10;
						else r = 0;
					}
					else {
						sum[i][y - j] = astr[y - j - 1];
					}
				}
			}
		}
		sum_n[i][0] = x; sum_n[i][1] = y; sum_n[i][2] = r;
		r = 0;
	}
	for (int i = 0; i < n; ++i) {
		x = sum_n[i][0]; y = sum_n[i][1]; r = sum_n[i][2];
		if (y <= 80 - r && x <= 80 - r) {
			if (r == 1) printf("%d", r);
			for (int j = 1; j <= x || j <= y; ++j) {
				printf("%c", sum[i][j]);
			}
		}
		else {
			printf("overflow");
		}
		printf("\n");
	}
}

C++: #include <iostream>
#include <string>
#include <algorithm>
 
int main(){
  std::string str1,str2,sumstr;
  while(std::cin>>str1>>str2){
    sumstr.clear();
    std::reverse(str1.begin(),str1.end());
    std::reverse(str2.begin(),str2.end());
    unsigned size=std::min(str1.size(),str2.size());
    unsigned i;
    unsigned carry=0;
    for(i=0;i<size;++i){
      unsigned sum=str1[i]+str2[i]+carry-'0'*2;
      sumstr.push_back(sum%10+'0');
      carry=sum/10;
    }
    std::string large=(str1.size()>str2.size())?str1:str2;
    for(;i<large.size();++i){
      unsigned sum=large[i]+carry-'0';
      sumstr.push_back(sum%10+'0');
      carry=sum/10;
    }
    if(carry)sumstr.push_back(carry+'0');
    std::reverse(sumstr.begin(),sumstr.end());
    sumstr.push_back('\0');
    if(sumstr.size()<=81)
      std::cout<<sumstr<<std::endl;
    else
      std::cout<<"overflow"<<std::endl;
  }
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
    int n;
    scanf("%d",&n);
    for(int j=0;j<n;j++){
        string a,b;
        cin>>a>>b;
        int numa[100000]={0},numb[100000]={0};
        int flag=0;
        for(int i=a.size()-1,k=0;0<=i;i--,k++)numa[k]=a[i]-'0';
        for(int i=b.size()-1,k=0;0<=i;i--,k++)numb[k]=b[i]-'0';
        int sum[81]={0};
        for(int i=0;i<max(a.size(),b.size());i++){
            sum[i]+=(numa[i]+numb[i]);
            sum[i+1]=sum[i]/10,sum[i]=sum[i]%10;
            if(sum[80]!=0){
                puts("overflow");
                goto exit;
            }
        }
        //printf("[%d]\n",sum[0]);
        for(int i=80;0<=i;i--){
            if(flag==1||sum[i]!=0)flag=1;
            if(flag==1)printf("%d",sum[i]);
        }
        puts("");
exit:
;
    }
    return 0;
}

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

class bigdata
{
public:
  list < int >data;
  string to_str ()
  {
    string str (data.size (), '0');
    int i = 0;
    auto it = data.begin ();
    while (it != data.end ())
      {
	string buf = to_string (*it);
	  str[i] = buf[0];
	  it++;
	  i++;
      }
    return str;
  }
  bigdata & operator= (string str)
  {
    for (int i = 0; i < str.length (); i++)
      data.push_back (stoi (str.substr (i, 1)));
  }
  bigdata & operator+ (bigdata & obj)
  {
    auto it_a = this->data.begin ();
    auto it_b = obj.data.begin ();
    if (this->data.size () < obj.data.size ())
      {
	int buf = obj.data.size () - this->data.size ();
	for (int i = 1; i <= buf; i++)
	  this->data.push_front (0);
      }
    if (this->data.size () > obj.data.size ())
      {
	int buf = this->data.size () - obj.data.size ();
	for (int i = 1; i <= buf; i++)
	  obj.data.push_front (0);
      }
    this->data.push_front (0);
    obj.data.push_front (0);

    while (it_a != this->data.end ())
      {
	*it_a += *it_b;
	if (*it_a >= 10)
	  {
	    --it_a;
	    *it_a += 1;
	    ++it_a;
	    *it_a -= 10;
	  }
	it_a++;
	it_b++;
      }
    it_a = this->data.begin ();
    if (*it_a == 0)
      this->data.pop_front ();
    return *this;
  }
};

int
main ()
{
  string s1, s2;
  while (cin >> s1 >> s2)
    {
      bigdata data1, data2;
      data1 = s1;
      data2 = s2;
      data1 = data1 + data2;
      cout << data1.to_str () << endl;
    }
}

C++: #include<stdio.h>
#include<math.h>

int main(void)
{
	int x,y,n,m,sum;
	scanf("%d",&n);

	for(int t=0;t<n;t++)
	{
		scanf("%d",&x);
		scanf("%d",&y);

		m=pow(10,80);
		sum=x+y;
		
		if(sum>m)
		{
			printf("overflow\n");
		}
		else
		{
			printf("%d",sum);
		}
	}
	return 0;
}

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

int chomp(char *str){
    int len = strlen(str);
    if(str[len-1]=='\n'){
        str[len-1] = '\0';
        len--;
    }
    return len;
}

int main(){
    int n;
    int i,j;
    int s1,s2,la,sm;
    char a1[103],a2[103],*pla,*psm,dummy[2];
    int carry,r;
    scanf("%d",&n);
    fgets(dummy,2,stdin);
    for(i=0;i<n;i++){
        fgets(a1,102,stdin);
        fgets(a2,102,stdin);
        s1 = chomp(a1);
        s2 = chomp(a2);
        if(s1>80||s2>80){
            printf("overflow\n");
            break;
        }
        if(s1<s2){
            pla = a2;
            la = s2;
            psm = a1;
            sm = s1;
        }else{
            pla = a1;
            la = s1;
            psm = a2;
            sm = s2;
        }
        carry = 0;
        for(j=0;j<la;j++){
            r = (j<sm) ? (psm[sm-j-1]-'0') : 0;
            r += (pla[la-j-1]-'0')+carry;
            carry = r/10;
            pla[la-j] = '0' + r%10;
        }
        if(carry){
            pla[0] = '1';
        }else{
            pla = (s1<s2) ? &a2[1] : &a1[1];
        }
        if(j+carry>80){
                printf("overflow\n");
                break;
        }
        printf("%s\n",pla);
    }
}