Advertisement
Guest User

Problem H

a guest
Mar 18th, 2012
182
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. USING: io kernel math math.parser strings sequences locals ascii ;
  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. rtn length 2 mod 0 =
  14. [ >upper rtn swap append ]
  15. [ >lower rtn swap append ]
  16. if
  17.  
  18. swap
  19. test
  20.  
  21. ]
  22. if ;
  23.  
  24.  
  25.  
  26. ""
  27. readln
  28. test
  29.  
  30. drop
  31. print
Advertisement
RAW Paste Data Copied
Advertisement