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 <iostream>
#include <algorithm>
#include <cstring>
using namespace std;

int main()
{
  int N;
  char str1[81];
  char str2[81];
  char s1[81];
  char s2[81];
  cin >> N;
  for(int i = 0; i < N; i++){
    cin >> str1;
    cin >> str2;
    int m1 = strlen(str1), m2 = strlen(str2);
    if(m1 > 80 || m2 > 80)
      cout << "overflow" << endl;
    else if(atoi(str1) + atoi(str2) < 2147483647 && atoi(str1) + atoi(str2) > 0)
      cout << atoi(str1) + atoi(str2) << endl; 
    else{
      if(m1 > m2){
	for(int i = 0; i < m1 - m2 + 1; i++)
	  s1[i] = '0';
	s1[m1 - m2] = '\0';
	strcat(s1, str2);
	strcpy(s2, str1);
      }else if(m2 > m1){
	for(int i = 0; i < m2 - m1; i++)
	  s2[i] = '0';
	s2[m2 - m1] = '\0';
	strcat(s2, str1);
	strcpy(s1, str2);
      }else{
	strcpy(s1, str2);
	strcpy(s2, str1);
      }
      char ans[81];
      int n = 0;
      for(int i = ((m1 > m2) ? m1 : m2) - 1; i >= 0; i--, n++)
	if((s1[i] - '0') + (s2[i] - '0') >= 10){
	  s1[i - 1] = s1[i - 1] + 1;
	  ans[i] = (s1[i]- '0') + (s2[i] - '0') + 38;
	}else
	  ans[i] = (s1[i] - '0') + (s2[i] - '0') + 48;
      ans[n] = '\0';
      if(n > 80)
	cout << "overflow" << endl;
      else{
	if((s1[0] - '0') + (s2[0] - '0') >= 10)
	  cout << "1";
	cout << ans << endl;
      }
    }
  }
}

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

string pls(string a,string b){
	string ret;
	reverse(a.begin(),a.end());
	reverse(b.begin(),b.end());
	if(a.size()<b.size())swap(a,b);
	while(a.size()!=b.size())b+='0';
	while(a.size()+1!=ret.size())ret+='0';
	for(int i=0;i < a.size(); i++){
		ret[i] = a[i] + b[i] + ret[i] - '0'*3;
		if(ret[i]>9){
			ret[i] = '0' + ret[i]%10;
			ret[i+1] = '1';
		}else{
			ret[i]= '0' + ret[i];
		}
	}
	
	reverse(ret.begin(),ret.end());
	if(~ret.find_first_not_of('0'))return ret.substr(ret.find_first_not_of('0'),ret.size()-ret.find_first_not_of('0'));
	else return "0";
}

int main(){
	string a,b;
	int n;
	
	cin >> n;
	while(n--){
		cin >> a >> b;
		cout << pls(a,b) << endl;
	}
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include<string.h>
#include <utility>
using namespace std;
using namespace std;
int main(){
	int m;
	string in,in2;
	int a[90],b[90],ans[90];
	int f;
	int alen,blen,mlen;
	cin>>m;
	while(m--){
		for(int i=0;i<90;i++){
			a[i]=b[i]=ans[i]=0;
		}
		cin>>in;
		cin>>in2;
		alen=in.size();
		blen=in2.size();
		for(int i=0;i<alen;i++){
			a[alen-1-i]=in[i]-'0';
		}
		for(int i=0;i<blen;i++){
			b[blen-1-i]=in[i]-'0';
		}
		mlen=max(alen,blen);
		if(mlen>80){
			cout<<"overflow"<<endl;
			continue;
		}
		f=0;
		for(int i=0;i<mlen+1;i++){
			ans[i]=(a[i]+b[i]+f)%10;
			f=(a[i]+b[i]+f)/10;
		}
		if(ans[mlen]!=0){
			//if(mlen>79){
				//cout<<"overflow"<<endl;
				//continue;
			//}
			//cout<<ans[mlen];
		}
		
		for(int i=0;i<mlen;i++){
			//cout<<ans[mlen-1-i];
		}cout<<endl;
		
		
	}
	return 0;
}

C++: //0015 National Budget
//80ÜÅÌ2ÂÌ®Ì«µZÊðoÍ¹æ
//1sÚÉf[^Zbgnª^¦çêé

#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;

int main(void)
{
	int n;
	cin >> n;
	while(n--)
	{
		const int N = 82;
		char a[N], b[N], c[N] = "";
		int i;

		cin >> a >> b;

		//CfbNXª¬³¢Ù¤©çºÌÉÈéæ¤É½ÎÉ·é
		reverse(a, a+strlen(a));
		reverse(b, b+strlen(b));

		bool isReadA = true, isReadB = true;
		for(i = 0; i < N; i++)
		{
			int s = 0;
			if(isReadA)
			{
				int lhv = a[i];
				if(!lhv)
					isReadA = false;
				else
					s += (lhv-'0');
			}
			if(isReadB)
			{
				int rhv = b[i];
				if(!rhv)
					isReadB = false;
				else
					s += (rhv-'0');
			}

			
			c[i] += s;
			if(c[i] >= 10)
			{
				c[i+1]++;
				c[i] -= 10;
			}
			c[i] += '0';

			if(!isReadA && !isReadB)
			{
				if(c[i] == '0')
					c[i] = '\0';
				break;
			}
		}

		reverse(c, c+strlen(c));
		cout << c << endl;
	}
	return 0;
}

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

int main(){
	int n;
	cin >> n;
	while( n-- > 0 ){
		string num1, num2;
		cin >> num1 >> num2;
		char sum[101];
		int degit = 0;
		for( int i = 0; i < 101; i++ ) sum[i] = '0';
		for( int i = 0; i < num1.size(); i++ ){
			sum[100-i] = num1[num1.size()-i-1];
		}
		int d;
		for( int i = 0; i < num1.size() || i < num2.size() || degit != 0; i++ ){
			int now = 3;
			/*
			if( i < num2.size() ){
				now = (int)(sum[100-i]-'0') + (int)(num2[num2.size()-i-1]-'0') + degit;
			}else{
				now = (int)(sum[100-i]-'0') + degit;
			}
			*/
			sum[100-i] = (char)(now%10)+'0';
			if( now >= 10 ) degit = 1;
			else degit = 0;
			d = i;
		}
		if( d < 80 ){
			for( int i = 100-d; i < 101; i++ ) cout << sum[i];
			cout << endl;
		}else{
			cout << "overflow" << endl;
		}
	}
}

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

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

   vector<int> V;

   for(int i = 0; i < n; i++){
     string a, b;
     int slength[2];

    
     cin >> a >> b;

     slength[0] = a.length();
     slength[1] = b.length();


     if(a.length() != 1)reverse(a.begin(), a.end());
     if(b.length() != 1)reverse(b.begin(), b.end());

     if(a.length() > b.length()){
       for(int j = 0; j < slength[0] - slength[1]; j++) b+="0";
     }else{
       for(int j = 0; j < slength[1] - slength[0]; j++) a+="0";
     }
     int flag = 0;

     for(int j = 0; j < a.length(); j++){
       if(flag){
	 a[j]++;
	 flag--;
       }
       if((a[j]+b[j]-96)/10 == 0){
	 V.push_back(a[j]+b[j]-96);
       }else{
	 flag++;
	 V.push_back((a[j]+b[j]-96)%10);
       }
     }
 
     if(flag) V.push_back(1);

     if(V.size()-1 >= 80){
       cout << "overflow" <<endl;
     }else{
       for(int j = V.size()-1; j >= 0; j--){
	 cout << V[j];
       }
       cout << endl;
     }
     V.clear();
   }  
   return 0;
}

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

#define N(c) (c-'0')

using namespace std;
 /*
	N	:整数文字列ペアの数
	ar[3][100]	:文字配列

 */



int main(){
	int i, j, k, n, s;
	char  ar[3][100], c;

  cin >> n;
  while(n--){
	  scanf("%s %s",ar[0],ar[1]);

	  for(i=0; i<2; i++){
		  j=strlen(ar[i]);
		  for(k=0; k<j/2; k++){
			  c=ar[i][k]; ar[i][k]=ar[i][j-k-1]; ar[i][j-k-1]=c;
		  }
	  }

    if(strlen(ar[0])<strlen(ar[1])){
      strcpy(ar[2], ar[1]); strcpy(ar[1], ar[0]); strcpy(ar[0], ar[2]);
    }

    i=strlen(ar[0]);
    j=strlen(ar[1]);
    for(k=0,s=0; k<j; k++){
      s += N(ar[0][k]) + N(ar[1][k]);
      ar[2][k]=(s%10)+'0';
      s=s/10;
    }

    for( ; k<i; k++){
      if(ar[0][k]=='\0')  ar[2][k]=s+'0';
      else{
        s += N(ar[0][j]);
        ar[2][k]=(s%10)+'0';         
        s=s/10;
      }
    }

    if(0==s)  ar[2][k]='\0';
    else {
      ar[2][k]=s+'0';
      ar[2][k+1]='\0';
    }

// printf("%s\n%s\n%s\n",ar[0],ar[1],ar[2]);


	  i=2;
		  j=strlen(ar[i]);
		  for(k=0; k<j/2; k++){
			  c=ar[i][k]; ar[i][k]=ar[i][j-k-1]; ar[i][j-k-1]=c;
		  }

  if(80<strlen(ar[2]))  	printf("overflow\n");
  else printf("%s\n",ar[2]);
	}
    return 0;
}