RosettaCodeData/Task/Modular-inverse/XPL0/modular-inverse.xpl0
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

7 lines
152 B
Text

code IntOut=11, Text=12;
int X;
def A=42, M=2017;
[for X:= 2 to M-1 do
if rem(A*X/M) = 1 then [IntOut(0, X); exit];
Text(0, "Does not exist");
]