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

int main(void)
{
  int N;
  scanf("%d", &N);

  int i,j,k;
  for(i=0; i<N; ++i){

    int digits[2][80];
    for(j=0; j<2; ++j){
      for(k=0; k<80; ++k){
        digits[j][k] = 0;
      }
    }

    int overflow = 0; 

    for(j=0; j<2; ++j){
      char digit[81];
      scanf("%81s", digit);
      getchar();
      
      if(overflow || strlen(digit)>80){
        overflow = 1;
      }else{
        for(k=0; k<strlen(digit); ++k){
          digits[j][k] = digit[strlen(digit)-1-k]-'0';
        }
      }
    }

    if(!overflow){
      int sum[81];
      for(j=0; j<81; ++j){
        sum[j] = 0;
      }

      for(j=0; j<80; ++j){
        for(k=0; k<2; ++k){
          sum[j] += digits[k][j];
        }
        sum[j+1] += sum[j]/10;
        sum[j] %= 10;
      }

      if(sum[80]>0){
        overflow = 1;
      }else{
        int available = 0;
        for(j=80; j>=0; --j){
          if(available || sum[j]!=0 || j==0){
            available = 1;
            printf("%d", sum[j]);
          }
        }
        printf("\n");
      }
    }

    if(overflow){
      printf("overflow\n");
    }
  }

  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<sstream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cctype>
#include<climits>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
#define P pair<int, int>
const int INF = INT_MAX / 2;
const int N = 80;

vector<int> makeDx(string str){
    reverse(str.begin(), str.end());
    vector<int> ret(N + 100, 0);
    REP(i, str.size()) ret[i] = str[i] - '0';
    return ret;
}

int main(){
    int n; cin >>n;
    REP(z, n){
        string str[2]; cin >>str[0] >>str[1];
        vector<int> dx[2] = {makeDx(str[0]), makeDx(str[1])};
        vector<int> ans(N + 100, 0);
        bool okflg = true;
        REP(i, N){
            int sum = dx[0][i] + dx[1][i];
            ans[i] += sum;
            if(i == N - 1 && ans[i] >= 10){
                cout <<"overflow" <<endl;
                okflg = false;
            }else if(ans[i] >= 10){
                ans[i + 1] = ans[i] / 10;
                ans[i] %= 10;
            }
        }

        if(okflg){
            reverse(ans.begin(), ans.end());
            int s = 0;
            while(ans[s] == 0 && s < (N + 100) - 1) s++;
            FOR(i, s, N + 100) cout <<ans[i];
            cout <<endl;
        }
    }
    return 0;
}

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

using namespace std;

int main(void)
{
	char a[256],b[256];
	int n,flag,count1,count2,count3,daisyo=0,miss=0;
	//n:aðßéñ flag:overflowÌmF count1:aÌ count2:bÌ count3:Ì· daisyo:aÆbÌå¬ÖW
	cin>>n;

	for (int i=0; i<n; i++) 
	{
		for(int i=0;i<256;i++){
			a[i]=0;
			b[i]=0;
		}
		flag=0;
		daisyo=0;
		miss=0;

		cin>>a>>b;
		count1= strlen(a);
		count2= strlen(b);
		
		if (count1>80||count2>80) {
			flag=1;
		}
		count3=count1-count2;//Ì·
		
		if(count2>count1)
		{
			count3*=-1;//Ì·ðC³
			daisyo=1;
		}
		
		if(daisyo==0)//ªa>bÌê
		{
			if(!(count1==count2))
			for(int j=0;j<=count2;j++)
			{
				b[count2-j+count3]=b[count2-j];//bÌðaÉí¹éæ¤C³
			}
			for (int j=0; j<count3; j++) {
				b[j]='0';
			}
			
			for (int j=1; j<=count1; j++) {
				a[count1-j]+=b[count1-j]-48;
				if (((int)a[count1-j])-48>9) 
				{
					if (j>=80) {
						flag=1;
						break;
					}
					a[count1-j]=(a[count1-j]-48)%10+48;
					if ((count1-j)==0) {
						miss=1;
					}
					else {
							a[count1-j-1]=a[count1-j-1]+1;

						
					}
				}
			}
		}
		
		else //ªb>aÌê
		{
			for(int j=0;j<=count1;j++)
			{
				a[count1-j+count3]=a[count1-j];//bÌðaÉí¹éæ¤C³
			}
			for (int j=0; j<count3; j++) {
				a[j]='0';
			}
			
			for (int j=1; j<=count2; j++) {
				b[count2-j]+=a[count2-j]-48;
				if (((int)b[count2-j]-48)>9) 
				{
					if (j>=80) {
						flag=1;
						break;
					}
					b[count2-j]=(b[count2-j]-48)%10+48;
					if ((count2-j)==0) {
						miss=1;
					}
					else {
						b[count2-j-1]=b[count2-j-1]+1;
					}
				}
			}
		}
		
		if(flag==1)
		{
			cout << "overflow" << endl;
		}
		
		else 
		{
			if (miss==1) {
				cout << '1';
			}
			if(daisyo==0) 
			{
				for (int j=0; j<count1; j++) 
				{
					cout << (int)a[j]-48;
				}
			}
			
			else 
			{
				for (int j=0; j<count2; j++) 
				{
					cout << (int)b[j]-48;
				}
			}
			cout << endl;

		}
		
		
	}
		
		
	
	return (0);
}

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

int main(){
	string a, b;
	vector<int> ans;
	int n, num, ai, bi, c=0;
	bool flag;

	cin >> n;
	
	for(int i=0 ; i<n ; i++){
		cin >> a >> b;
		flag = false;
		
		for(int j=0 ; j<100 ; j++){
			num = 0;
			ai = a.size()-j-1;
			bi = b.size()-j-1;
			if( ai<0 && bi<0 && c==0) break;
			
			if(ai>=0)num += a[ ai ] - 48;
			if(bi>=0)num += b[ bi ] - 48;
			ans.push_back( (num+c)%10 );
			if(num+c >= 10) c = 1;
			else c = 0;
		}
		if(ans.size()>80){
			flag = true;
		}
		if(flag){
			printf("overflow");
		}else{
			for(int j=ans.size()-1 ; j>=0 ; --j){
				printf("%d", ans[j]);
			}
		}
		printf("\n");
		ans.clear();
	}
	return 0;
}

C++: #include<stdio.h>
#include<string.h>
int max(int a,int b){return a>b?a:b;}
int main(){
	int n,i,j;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		char a[81];
		char b[81];
		char x[81];
		char y[81];
		char ans[82];
		scanf(" %s",a);
		scanf(" %s",b);
		for(j=0;j<80;j++){
			x[j]='0';
			y[j]='0';
		}
		x[80]='\0';
		y[80]='\0';
		for(j=0;j<strlen(a);j++)x[79-j]=a[strlen(a)-1-j];
		for(j=0;j<strlen(b);j++)y[79-j]=b[strlen(b)-1-j];
		int k=0;
		for(j=80;j>=1;j--){
			int p=0;
			p+=k;
			p+=(x[j-1]-'0')+(y[j-1]-'0');
			k=p/10;
			ans[j]=p%10+'0';
		}
		ans[0]='0';
		ans[81]='\0';
		j=0;
		while(j<=81&&ans[j]=='0')j++;
		if(k!=0)printf("overflow\n");
		else if(j==81)printf("0\n");
		else{
			for(;j<81;j++){
				printf("%c",ans[j]);
			}
			printf("\n");
		}
	}
	return 0;
}

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

using namespace std;

int main(){
  string str1,str2;
  int testnum;

  cin>>testnum;
  int t=0;
  while(t<testnum&&cin>>str1>>str2){
    string sumstr;
    reverse(str1.begin(),str1.end());
    reverse(str2.begin(),str2.end());

    unsigned size=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;
    }

    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');
    reverse(sumstr.begin(),sumstr.end());

    if(sumstr.size()<=81)
      cout<<sumstr<<endl;
    else
      cout<<"overflow"<<endl;
    t++;
  }
}