fork download
  1. #!/usr/bin/guile \
  2. -e main -s
  3. !#
  4.  
  5. (use-modules ((srfi srfi-1)
  6. #:select (last unfold)))
  7.  
  8. (define (Func num max)
  9. (modulo
  10. (last
  11. (unfold (lambda (x) (> (* x (modulo x 10)) max))
  12. (lambda (x) x)
  13. (lambda (x) (1+ x))
  14. num)) 10))
  15.  
  16. (define (main args)
  17. (with-exception-handler
  18. (lambda (ex)
  19. (display "wrong number of arguments")
  20. (newline))
  21. (lambda ()
  22. (format #t "N = ~a~%"(apply Func (map string->number (cdr args)))))))
  23.  
  24.  
Runtime error #stdin #stdout #stderr 0.01s 5272KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Wrong __data_start/_end pair