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 ( z n f -- a b c )
- f 1 =
- [ z n f ]
- [
- z
- n f *
- dup 10 mod 0 = [ swap 1 + swap 10 / ] [ ] if
- dup 10 mod 0 = [ swap 1 + swap 10 / ] [ ] if
- dup 10 mod 0 = [ swap 1 + swap 10 / ] [ ] if
- dup 10 mod 0 = [ swap 1 + swap 10 / ] [ ] if
- dup 10 mod 0 = [ swap 1 + swap 10 / ] [ ] if
- dup 10 mod 0 = [ swap 1 + swap 10 / ] [ ] if
- dup 10 mod 0 = [ swap 1 + swap 10 / ] [ ] if
- dup 10 mod 0 = [ swap 1 + swap 10 / ] [ ] if
- dup 10 mod 0 = [ swap 1 + swap 10 / ] [ ] if
- 1000000000 mod
- f
- 1
- -
- test
- ]
- if ;
- 0
- 1
- readln string>number
- test
- drop
- drop
- number>string print
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement