Advertisement
Guest User

Problem D

a guest
Mar 18th, 2012
233
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None
  1. USING: io kernel math math.parser strings sequences locals ;
  2.  
  3. IN: template
  4.  
  5. :: test ( rtn cur -- a b )
  6.  
  7. cur "" =
  8. [ rtn cur ]
  9. [
  10. cur 1 tail
  11. cur 1 head
  12.  
  13.  
  14. dup "1" = [ drop "" ] [ ] if
  15. dup "2" = [ drop "" ] [ ] if
  16. dup "3" = [ drop "" ] [ ] if
  17. dup "4" = [ drop "" ] [ ] if
  18. dup "5" = [ drop "" ] [ ] if
  19. dup "6" = [ drop "" ] [ ] if
  20. dup "7" = [ drop "" ] [ ] if
  21. dup "8" = [ drop "" ] [ ] if
  22. dup "9" = [ drop "" ] [ ] if
  23. dup "0" = [ drop "" ] [ ] if
  24.  
  25. rtn
  26. swap
  27. append
  28. swap
  29. test
  30.  
  31. ]
  32. if ;
  33.  
  34.  
  35.  
  36.  
  37.  
  38. ""
  39. readln
  40. test
  41.  
  42. drop
  43. print
Advertisement
RAW Paste Data Copied
Advertisement