Advertisement
Guest User

Untitled

a guest
Oct 24th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.22 KB | None | 0 0
  1. #lang racket
  2. (define (switch-digits x)
  3.  
  4.   (define (count-digits cnt)
  5.     (let ([y x]) y)
  6.     (if (= (/ x 10) 0)
  7.         (cnt)
  8.         ((count-digits) (/ x 10) (+ cnt 1) (let [(y (/ y 10))] y
  9.     )
  10.   )
  11.   ))
  12.   )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement