Advertisement
Guest User

Teste maior primo

a guest
Jun 23rd, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. def ePrimo(k):
  2.     primo = 1
  3.     cont = 0
  4.     while k >= primo:
  5.         if k % primo == 0:
  6.             primo = k % primo
  7.             primo = primo + 1
  8.             cont = cont + 1
  9.             if cont == 2:
  10.                 print ("maior_primo", k)
  11.             else:
  12.                 def maior_primo(x):
  13.                     x = 1
  14.                     if cont > 2:
  15.                         while k >= x:
  16.                             x = k % x
  17.                             x = x + 1
  18.                             cont = cont + 1
  19.                             if x == ePrimo:
  20.                                 print("maior_primo", x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement