摘要:
procedure exgcd(a,b:int64);
var
t:longint;
begin
if b=0 then
begin
x:=1;y:=0;
exit;
end else
exgcd(b,a mod b);
t:=x;x:=y;y:=t-(a div b)*y;
end;
function cfny(a:int64):int64;
var
b:longint;
begin
b:=zs;
exgcd(a,b);
cfny:= ((x mod zs)+zs) mod zs;
end; 阅读全文