I just tried using "."0 ": and it does exactly what I want. 
Thanks.I just need to study ". and ":
> Date: Wed, 28 May 2014 08:30:33 -0700
> From: rogerhui.can...@gmail.com
> To: programm...@jsoftware.com
> Subject: Re: [Jprogramming] Project Euler 20
> 
>    +/ "."0 ": !100x
> 648
> 
> 
> 
> On Wed, May 28, 2014 at 8:26 AM, Jon Hough <jgho...@outlook.com> wrote:
> 
> > Project Euler Question 20 is:
> > n! means n  (n  1)  ...  3  2  1
> > For example, 10! = 10  9  ...  3  2  1 = 3628800,
> >
> > and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 =
> > 27.
> > Find the sum of the digits in the number 100!
> > http://projecteuler.net/problem=20
> >
> > My solution:
> > NB. create the base to split number
> >
> >
> > base =. 200 $ 10
> >
> >
> > NB. sum all
> >
> >
> > +/ @: (base & #: )@: ! 100x
> >
> > I get the correct answer with this, but I am wondering if there is a
> > terser or more elegant way to get the solution?
> > In particular I am not too happy about having to explicitly define the
> > base. Is there a better way to convert numbers to arrays of their digits?
> >
> >
> > Regards.
> >
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
                                          
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to