program Random3;
uses
System.SysUtils;
var
A: array [1..3] of Integer;
i: Integer;
b: Boolean;
begin
Randomize;
Write ('Три случайный числа: ');
for i := Low (A) to High (A) do begin
A [i] := Random (9) + 1;
Write (A [i], ' ');
end;
b := True;
for i := Low (A) to High (A) do
if A [i] mod 3 <> 0 then begin
b := False;
Break;
WriteLn;
if b then
WriteLn ('OK')
else
WriteLn ('NO OK');
ReadLn;
end.
program Random3;
uses
System.SysUtils;
var
A: array [1..3] of Integer;
i: Integer;
b: Boolean;
begin
Randomize;
Write ('Три случайный числа: ');
for i := Low (A) to High (A) do begin
A [i] := Random (9) + 1;
Write (A [i], ' ');
end;
b := True;
for i := Low (A) to High (A) do
if A [i] mod 3 <> 0 then begin
b := False;
Break;
end;
WriteLn;
if b then
WriteLn ('OK')
else
WriteLn ('NO OK');
ReadLn;
end.