fork(1) download
  1. local acum = 1
  2. local n1 = 6
  3. for i = 1, 9, 1 do
  4. if n1 % 2 == 0 then
  5. acum = acum * 2
  6. n1 = n1 / 2
  7. elseif n1 % 3 == 0 then
  8. acum = acum * 3
  9. n1 = n1 / 3
  10. elseif n1 % 5 == 0 then
  11. acum = acum * 5
  12. n1 = n1 / 5
  13. elseif n1 % 7 == 0 then
  14. acum = acum * 7
  15. n1 = n1 / 7
  16. end
  17. if n1 == 1 then break end
  18. end
  19. print(acum)
Success #stdin #stdout 0s 2844KB
stdin
Standard input is empty
stdout
6