Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

primebench

a guest Apr 29th, 2018 105 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. import math
  2. import time
  3. import os
  4.  
  5. t1=time.time()
  6. skip=False
  7. for i in range(2, 1001):
  8.     skip=False
  9.     k = math.floor(math.sqrt(float(i))) + 1.0
  10.     for j in range(2, int(k)):
  11.         k1=i/float(j)
  12.         k2=int(k1)
  13.         if k1==k2:
  14.             skip=True
  15.             break
  16.     if skip:
  17.         continue
  18.     print(i)
  19. t2=time.time()
  20. print("TIME=" + str(t2-t1))
  21. os.system("pause")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top