Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- USING: io kernel math math.parser strings sequences locals ;
- IN: template
- :: test ( rtn cur -- a b )
- cur "" =
- [ rtn cur ]
- [
- cur 1 tail
- cur 1 head
- 0
- swap
- dup "H" = [ swap 1 + swap ] [ ] if
- dup "Q" = [ swap 1 + swap ] [ ] if
- dup "9" = [ swap 1 + swap ] [ ] if
- drop
- rtn
- +
- swap
- test
- ]
- if ;
- 0
- readln
- test
- drop
- 0 =
- [ "NO" ]
- [ "YES" ]
- if
- print
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement