home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / ipl / progs / pdecomp.icn < prev    next >
Text File  |  2000-07-29  |  792b  |  35 lines

  1. ############################################################################
  2. #
  3. #    File:     pdecomp.icn
  4. #
  5. #    Subject:  Program to list primes factors of an integer
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     December 12, 1995
  10. #
  11. ############################################################################
  12. #
  13. #   This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  This program lists the prime factors of integers given in
  18. #  standard input.
  19. #
  20. ############################################################################
  21. #
  22. #  Links:  factors  
  23. #
  24. ############################################################################
  25.  
  26. link factors
  27.  
  28. procedure main()
  29.    local i
  30.  
  31.    while i := factors(read()) do
  32.       every write(!i)
  33.  
  34. end
  35.