pascal
Объяснение:
var x, y, z: byte;
function prost(n: integer): boolean;
var i: integer;
begin
prost:=true;
for i := 2 to Round(Sqrt(n)) do
if n mod i = 0 then prost := false;
end;
randomize;
repeat
x := random(253) + 2;
y := random(253) + 2;
z := random(253) + 2;
until (prost(x) and prost(y) and prost(z) and (x <> y) and (x <> z) and (y <> z));
WriteLn('(',x,' * ',y,') / ',z,' = ',(x*y) div z,'. Остаток ',(x*y) mod z );
end.
pascal
Объяснение:
var x, y, z: byte;
function prost(n: integer): boolean;
var i: integer;
begin
prost:=true;
for i := 2 to Round(Sqrt(n)) do
if n mod i = 0 then prost := false;
end;
begin
randomize;
repeat
x := random(253) + 2;
y := random(253) + 2;
z := random(253) + 2;
until (prost(x) and prost(y) and prost(z) and (x <> y) and (x <> z) and (y <> z));
WriteLn('(',x,' * ',y,') / ',z,' = ',(x*y) div z,'. Остаток ',(x*y) mod z );
end.