Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- USING: io kernel math math.parser strings sequences locals ascii ;
- IN: template
- :: test ( out d n -- a b c )
- n 1 =
- [ out d n ]
- [
- n
- d
- mod 0 =
- [
- out 1 +
- d
- n d /
- ]
- [ out d 1 + n ]
- if
- test
- ]
- if ;
- :: testb ( out n -- a b )
- n length 0 =
- [ out n ]
- [
- 0
- 2
- n string>number
- test
- drop drop
- 1 -
- out +
- n 1 tail
- testb
- ]
- if ;
- 0
- readln
- testb
- drop
- 0 =
- [ "YES" ]
- [ "NO "]
- if
- print
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement