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 <math.h>

using namespace std;


int main(){
	char buf1[101],buf2[101];
	bool FLG1,FLG2;
	int n,length1,length2,S1,S2,num1_index,num2_index,kuriagari=0,check1,check2;
	int output[9],num1[9],num2[9];
	scanf("%d",&n);

	for(int loop=0;loop<n;loop++){
		length1 = length2 = 0;
		scanf("%s",buf1);
		scanf("%s",buf2);
		for(int i=0; buf1[i] !='\0';i++)length1++;
		for(int i=0; buf2[i] !='\0';i++)length2++;

		if(length1 >=81 || length2 >= 81)printf("overflow\n");
		else{
			FLG1=FLG2=false;
			num1_index = num2_index = 0;
			for(int k=0;k<9;k++){
				num1[k] = num2[k] = output[k]=-1;//????????¨??????????????????
			}

			for(int k=0;k<80&&(FLG1==false||FLG2==false);){
				S1=S2=0;
				check1=check2=0;
				for(int p=0;p<9&&k<80;p++,k++){
					if(k <= length1-1){
						S1 = 10*S1 + (buf1[k] - '0');
						check1++;
					}else{
						FLG1=true; //??????
					}

					if(k <= length2-1){
						S2 = 10*S2+(buf2[k] - '0');
						check2++;
					}else{
						FLG2=true; //??????
					}
				}
				if(check1>0){
					num1[num1_index++] = S1;
				}
				if(check2>0){
					num2[num2_index++] = S2;
				}
			}

			for(int calc=0;calc<=8;calc++){
				if(num1[calc] == -1 && num2[calc] == -1){
					if(kuriagari != 0){
						output[calc] = kuriagari;
					}
					break;
				}else{
					output[calc] = kuriagari;
					if(num1[calc] != -1){
						output[calc] += num1[calc];
					}
					if(num2[calc] != -1){
						output[calc] += num2[calc];
					}
					if(output[calc]/1000000000 >= 1){
						kuriagari = output[calc]/1000000000;
						output[calc] %= 1000000000;
					}else{
						kuriagari = 0;
					}
				}
			}

			if(output[8]/100000000 >= 1){
				printf("overflow\n");
			}else{
				bool firstFLG=true;
				for(int show=8;show>=0;show--){
					if(output[show] != -1){
						if(firstFLG == false && output[show] < 100000000){
							printf("%09d",output[show]);
						}else{
							printf("%d",output[show]);
							firstFLG = false;
						}
					}
				}
				printf("\n");
			}
		}
	}

    return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
using namespace std;
int main(void)
{
	int y;
	scanf("%d",&y);
	for(int z = 0;z < y;z++)
	{
		char suji1[100000],suji2[100000];
		char ans[100000] = {0};

		for(int i = 0;i<82;i++)
		{
			suji1[i] = '0';
			suji2[i] ='0';
		}

		int overflow = 0;

		scanf("%s",suji1);
		scanf("%s",suji2);
		int suji1s = strlen(suji1);
		int suji2s = strlen(suji2);

		int anss;
		if(suji1s>suji2s)  anss = suji1s;
		else anss = suji2s;

		suji1[suji1s] = '0';
		suji2[suji2s] = '0';

		reverse(suji1,suji1+suji1s);
		reverse(suji2,suji2+suji2s);

		for(int i = 0;i < 80;i++)
		{
			ans[i] = suji1[i]+suji2[i] - '0';
			if(ans[i] >= ':')
			{
				ans[i]  = ans[i] - 10;
				suji2[i+1] = suji2[i+1]+1;
			}
		}
		
		if(ans[anss]!= '0') anss++;
		if(anss >=81) overflow = 1;
		reverse(ans,ans+anss);
		ans[anss] = 0;
		if(overflow >= 1)
		{
			printf("overflow\n");
		}
		else
		{
			printf("%s\n",ans);
		}
		
	}
	return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<stdlib.h>
#include<time.h>
#include<math.h>
using namespace std;
char a[101];
char b[101];
char c[101];
char d[101];
int main()
{
   int n;
   scanf("%d",&n);
   while(n--)
   {
       memset(a,'0',sizeof(a));
       memset(b,'0',sizeof(b));
      scanf("%s",c);
      scanf("%s",d);
      int k1=strlen(c);
       int k2=strlen(d);
       int k=max(k1,k2);
       for(int i=0;i<k1;i++)
       {
           a[i]=c[k1-1-i];
       }
        for(int i=0;i<k2;i++)
       {
          b[i]=d[k2-1-i];
       }
       int d=0;
       for(int i=0;i<=k;i++)
       {
           int s=a[i]-'0'+b[i]-'0'+d;
           a[i]=s%10;
           d=s/10;
       }
       if(a[k]==0)
           {
               a[k]='0';
           }
       int p;
       for(int i=k;i>=0;i--)
       {
           if(i!='0')
           {
               p=i;
               break;

           }
       }
int l=0;
        if(p>80)
        {
            printf("overflow\n");
        }
        else
        {
            for(int i=k;i>=0;i--)
            {
                if(a[i]!='0')
                {
                    l=1;
                }
                if(l==1)
                {
                      printf("%d",a[i]);
                }

            }
            printf("\n");
        }
   }
}

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

int a[101] {0};
int b[101] {0};
int sum[55][101] {0};

int trans(char);

int main()
{
    int n;
    cin >> n;

    for (int i = 0; i < n; i++)
    {
        string s1, s2;
        cin >> s1 >> s2;
        int l1 = s1.length(), l2 = s2.length();
        for (int j = l1 - 1; j >= 0; j--)
        {
            a[l1-1-j] = trans(s1[j]);
        }
        for (int j = l2 - 1; j >= 0; j--)
        {
            b[l2-1-j] = trans(s2[j]);
        }

        int ll = max(l1, l2);
        for (int j = 0; j < ll; j++)
            sum[i][j] = a[j] + b[j];

        for (int j = 0; j < ll; j++)
        {
            sum[i][j+1] += sum[i][j] / 10;
            sum[i][j] %= 10;
        }


        for (int j = 0; j < 101; j++)
        {
            a[j] = 0;
            b[j] = 0;
        }

    }

    for (int i = 0; i < n; i++)
    {
        bool over = false;
        for (int j = 100; j >= 80; j--)
        {
            if (sum[i][j]>0)
            {
                over = true;
                break;
            }
        }

        if (over)
        {
            cout << "overflow" << endl;
            continue;
        }
        else
        {
            int j = 80;
            while (sum[i][j] <= 0)
                j--;
            while (j >= 0)
            {
                cout << sum[i][j];
                j--;
            }
            cout << endl;
        }
    }

    return 0;
}

int trans(char ch)
{
    switch (ch)
    {
    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;

    }
}

C++: #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main( void )
{
	while (1)
	{
		int n;
		cin >> n;
		if ( cin.eof() )
			break;
		for ( int i = 0; i < n; i++ )
		{
			string a;
			string b;
			cin >> a >> b;

			reverse( a.begin(), a.end() );
			reverse( b.begin(), b.end() );

			string::iterator it_a = a.begin();
			string::iterator it_b = b.begin();

			string kotae;
			int carry = 0;
			while ( it_a != a.end() || it_b != b.end() )
			{
				int an;
				int bn;
				if ( it_a != a.end() )
					an = ((*it_a) - '0');
				else
					an = 0;

				if ( it_b != b.end() )
					bn = ((*it_b) - '0');
				else
					bn = 0;

				int cn = an + bn + carry;
				if ( cn >= 10 )
				{
					carry = 1;
					cn %= 10;
					kotae += ('0' + cn);
				}
				else
				{
					carry = 0;
					kotae += ('0' + cn);
				}

				if ( it_a != a.end() )
					it_a++;
				if ( it_b != b.end() )
					it_b++;
			}

			if ( carry == 1 )
				kotae += '1';

			reverse( kotae.begin(), kotae.end() );

			cout << kotae << endl;

		}
	}

	return 0;
}