Guest User

Untitled

a guest
Aug 17th, 2021
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. import time
  2. t0= time.clock()
  3. def Main(num):
  4.     a = num
  5.     z1 = 0
  6.     z2 = 0
  7.     sch = 0
  8.     while a > 1:
  9.         tel = 2
  10.         untel = 3
  11.         z2 = z1
  12.         if a % tel == 0:
  13.             a //= tel
  14.             #print(tel)
  15.             z1 = tel
  16.         elif a % untel == 0:
  17.             a //= untel
  18.             #print(untel)
  19.             z1 = untel
  20.         else:
  21.             while a % untel != 0:
  22.                 untel +=2
  23.             a //= untel
  24.             z1 = untel
  25.         if z1 != z2:    
  26.             sch += 1
  27.  
  28.     return sch
  29.        
  30.  
  31. print(Main(1000))
  32. t1 = time.clock() - t0
  33. print("Time elapsed: ", t1 - t0)
Advertisement
Add Comment
Please, Sign In to add comment