kburnik

Logo - Je li broj prost?

Feb 19th, 2013
48
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. to jeliprost :n
  2. if :n = 1 [op "false]
  3. make "p int :n/2
  4. for [k 2 :p 1] [
  5. if (remainder :n :k) = 0 [op "false]
  6. ]
  7. op "true
  8. end
  9.  
  10. to testiraj :max
  11. for [i 1 :max 1] [if jeliprost :i [pr :i] ]
  12. end
  13.  
  14.  
  15. ; pozvati primjer:
  16. ; testiraj 50
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×