fork(4) download
  1. # brute-force
  2. n = int(raw_input())
  3. f = 2
  4. while n > 1:
  5. while n % f == 0:
  6. n //= f
  7. f += 1
  8.  
  9. print "max prime factor", (f - 1)
Success #stdin #stdout 0.09s 10904KB
stdin
13195
stdout
max prime factor 29