Advertisement
Guest User

Q_5

a guest
Jan 19th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. # Questao_5
  2.  
  3. def fatorial(x):
  4.     if (x == 0):
  5.         return 1
  6.     return x * fatorial(x-1)
  7.  
  8. def divisores(x):
  9.     divisores = 0
  10.     for possivel_divisor in range(1, x+1):
  11.         if (x % possivel_divisor == 0):
  12.             divisores = divisores + 1
  13.     return divisores
  14.  
  15. x = int(input())
  16. fat = fatorial(x)
  17. resposta = divisores(fat)
  18.  
  19. print (resposta)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement