fork download
  1. local read, write = io.read, io.write
  2. local b=2
  3. local n, sum = 1,0
  4. while n <= 100 do
  5. sum = 0
  6. b = 2
  7. while b*b <= n do
  8. if n%b == 0 then
  9. sum = sum + b
  10. if b*b != n then
  11. sum = sum + (n/b)
  12. end
  13. end
  14. b = b+1
  15. end
  16.  
  17. if sum == n then write(n)
  18. end
  19. end
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
compilation info
luac: prog.lua:10: 'then' expected near '!'
stdout
Standard output is empty