fork download
  1. local function Pow(n1, n2, m) --возведение в степень по модулю
  2. local c = 1
  3. for i = 1, n2 do
  4. c = (c * n1) % m
  5. end
  6. return c
  7. end
  8.  
  9. for i = 1, 30 do
  10. print(Pow(2, 1000000, 37))
  11. end
Success #stdin #stdout 0.71s 4216KB
stdin
Standard input is empty
stdout
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12