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 <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>

using namespace std;
typedef long long ll;

#define PI 3.141592653

int main(){
    string A,B;
    int n,Ak,Bk,ans[81];
    
    scanf("%d",&n);
    
    for(int i=0;i<n;i++){
        
        for(int j=0;j<80;j++){
            ans[j]=0;
        }
        
        cin >> A >> B;
        
        if(A==B && A=="0"){
            printf("0\n");
            continue;
        }
        
        Ak=(int)A.size();
        Bk=(int)B.size();
        
        if(Ak>80 || Bk>80){
            puts("overflow");
            continue;
        }
        
        for(int j=0;j<max(Ak,Bk);j++){
            if(j<min(Ak,Bk))
                ans[79-j]+=(A[Ak-1-j]-'0')+(B[Bk-1-j]-'0');
            else if(j<Ak)
                ans[79-j]+=A[Ak-1-j]-'0';
            else if(j<Bk)
                ans[79-j]+=B[Bk-1-j]-'0';
            
            if(ans[79-j]>=10){
                if(j==79){
                    break;
                }
                ans[79-j-1]++;
                ans[79-j]-=10;
            }
        }
        
        if(ans[0]>=10){
            puts("overflow");
        }else{
            bool f = false;
            for(int j=0;j<80;j++){
                if(ans[j]>0 || f){
                    printf("%1d",ans[j]);
                    f = true;
                }
            }
            printf("\n");
        }
    }
    
    return 0;
}

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


int main(){
  int n,i,j;
  string a,b;
  char sum[110]={};
  fill(sum,sum+110,'0');
  int up = 0;
  cin >> n;
  for(i=0;i<n;i++){
    cin >> a >> b;
    int sa=a.size(),sb=b.size();
    int flag=0;
    if(sa>=80||sb>=80) flag =1;
    for(j=0;j<max(sa,sb);j++){
      if(sa>j&&sb>j){
	sum[j] = (a[sa-j-1]-'0') + (b[sb-j-1]-'0') + up;
      }else if(sa>j){
	sum[j] = (a[sa-j-1]-'0') + up;
      }else if(sb>j){
	sum[j] = (b[sb-j-1]-'0') + up;
      }
      up=0;
      if(sum[j]>9){
	up=1;
	sum[j]-=10;
      }
      sum[j]+='0';
    }
    sum[max(sa,sb)]=up;
    int k=110-1;
    while(sum[k]-'0'==0&&k>0) k--;
    if(k>=80||flag==1) cout << "overflow";
    else
    for(j=k;j>=0;j--)
      cout << sum[j];
    cout << endl;
  }
}

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

int main(){
	string s1,s2;
	int num;
	cin>>num;
	for(int j=0;j<num;j++){
		cin>>s1;
		cin>>s2;
		int size1=s1.size();
		int size2=s2.size();
		if(size1>80 || size2>80){
			cout<<"overflow"<<endl;
			continue;
		}
		if(size1>size2){
			for(int a=0;a<(size1-size2);a++){
				s2='0'+s2;
			}
		}else if(size1<size2){
			for(int a=0;a<(size2-size1);a++){
				s1='0'+s1;
			}
		}
		string ans="";
		int plus=0;
		for(int i=max(size1,size2)-1;i>=-1;i--){
			if(i==-1){
				if(plus!=0){
					ans=(char)(plus+'0')+ans;
					continue;
				}else{
					continue;
				}
			}
			int alt=(s1[i]-'0')+(s2[i]-'0')+plus;
			if(alt>=10){
				ans=(char)(alt-10+'0')+ans;
				plus=alt/10;
			}else ans=(char)(alt+'0')+ans;
		}
		if(ans.size()>80){
			cout<<"overflow"<<endl;
		}else{
			cout<<ans<<endl;
		}
	}
	return 0;
}

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

void reverseString(char *str){
	char *hoge;
	int length;

	hoge = (char *)malloc( sizeof(char) * strlen(str) );
	
	length = strlen(str);
	for(int i=0 ; i<length ; i++){
		hoge[length-i-1] = str[i];
	}
	for(int i=0 ; i<length ; i++){
		str[i] = hoge[i];
	}
	free(hoge);
}

int main(){
	char a[1000], b[1000], c[1000];
	int n, num1, num2, index;
	bool flag, printFlag;

	scanf("%d", &n);
	for(int i=0 ; i<n ; i++){
		//ÏÌú»
		for(int j=0 ; j<1000 ; j++){
			a[j] = 0;
			b[j] = 0;
			c[j] = 0;
		}
		flag = false;

		//QÂÌlðüÍ(¶ñÆµÄzñÉi[)
		scanf("%s", a);
		scanf("%s", b);

		//QÂÌlÌªáÁÄàvZÅ«éæ¤É¶ñðtÉ·é
		reverseString(a);
		reverseString(b);
		//QÂÌlª80ð´¦Ä¢½çtOð§Äé
		if( strlen(a)>80 || strlen(b)>80){
			flag = true;
		}
		//aðvZ·é
		for(int j=0 ; j<100 ; j++){
			if(flag) break;

			//48ø¢Ä¶ñ©çlÉÏ··é
			if(a[j]>=48)a[j] -= 48;
			if(b[j]>=48)b[j] -= 48;
			
			c[j] += (a[j]+b[j])%10;
			if( (a[j]+b[j]) >=10 ){//Jèãªè
				c[j+1]++;
			}
		}
		for(int j=79 ; j>=0 ; j--){
			if(c[j] != 0){
				index = j;
				break;
			}
		}
		for(int j=0 ; j<index ; j++){
			if(c[j]!=0)break;
			else c[j] += 48;
		}
		reverseString(c);
		if(strlen(c)>80){
			flag = true;
		}
		for(int j=0 ; j<=index ; j++){
			if( flag==false ){
				if(c[j]==48) c[j] = 0;
				printf("%d", c[j]);
			}
		}
		if(flag){
			printf("overflow");
		}
		printf("\n");
	}
	return 0;
}

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

using namespace std;

int A[90],B[90],C[90];

int main()
{
    int n;
    cin >> n;
    while(n > 0)
    {
        n--;
        string str1,str2;
        cin >> str1 >> str2;
        int len1 = str1.length();
        int len2 = str2.length();
        if(len1 < len2)
        {
            string st = str1;
            str1 = str2;
            str2 = st;
            int ll = len1;
            len1 = len2;
            len2 = ll;
        }
        for(int i = 0; i < 90; i++)
            C[i] = 0;
        for(int i = 0; i < len1; i++)
            A[i] = str1[len1 - 1 - i] - '0';
        for(int i = 0; i < len2; i++)
            B[i] = str2[len2 - 1 - i] - '0';
        for(int i = 0 ; i < len2; i++)
        {
            C[i] = (A[i] + B[i]) % 10;
            C[i+1] = (A[i] + B[i]) / 10;
        }
        for(int i = len2; i <len1; i++)
        {
             C[i] = C[i] + A[i];
             C[i+1] = C[i] / 10;
             C[i] = C[i] % 10;
        }


        if(C[80] > 0)
            cout << "overflow" << endl;
        else
            {
                if(C[len1] > 0)
                    len1++;
                for(int i = len1-1; i >= 0; i--)
                    cout << C[i];
                cout << endl;
            }
    }
    return 0;
}