>>334 C++

#include <iostream>
#include <string>
#include "gmpxx.h"
int main () {
  int sq_me;
  while( std::cin >> sq_me ){
    int prec = 1000*sq_me, cnt = 0;
    mpf_class sq_out = sqrt( mpf_class(sq_me, prec*4) );
    mp_exp_t exp;
    auto str = sq_out.get_str( exp,10,prec );
    for( auto it=str.begin(); it!=str.end(); it++ ) if( *it=='0' ) ++cnt;
    std::cout << "N = " << sq_me << " => " << cnt+prec-str.length() << '\n';
  }
}

N = 3 => 309
N = 5 => 493
N = 7 => 738
N = 11 => 1079
N = 13 => 1305
N = 17 => 1664
N = 19 => 1875
N = 23 => 2265
N = 29 => 2911
N = 31 => 3113
N = 37 => 3795
N = 41 => 4095
N = 43 => 4312
N = 47 => 4798
N = 53 => 5340