Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
34
Task/Modular-inverse/Craft-Basic/modular-inverse.basic
Normal file
34
Task/Modular-inverse/Craft-Basic/modular-inverse.basic
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
let e = 42
|
||||
let t = 2017
|
||||
|
||||
gosub modularinverse
|
||||
|
||||
end
|
||||
|
||||
sub modularinverse
|
||||
|
||||
let d = 0
|
||||
|
||||
if e < t then
|
||||
|
||||
let b = e
|
||||
let c = 1
|
||||
|
||||
do
|
||||
|
||||
let s = int(((t - b) / e) + 1)
|
||||
let b = b + s * e
|
||||
let c = c + s
|
||||
let b = b - t
|
||||
|
||||
loop b <> 1
|
||||
|
||||
let d = c
|
||||
|
||||
endif
|
||||
|
||||
let m = d
|
||||
|
||||
print m
|
||||
|
||||
return
|
||||
Loading…
Add table
Add a link
Reference in a new issue