function k15(a:integer):boolean;
begin
k15:=a mod 15 = 0;
end;
var i: integer;
for i:=200 to 300 do
if k15(i) then write(i,' ');
end.
Результат:
210 225 240 255 270 285 300
var x: integer;
function D15(x: integer) : boolean;
if (x mod 15) = 0 then D15 := true else D15 := false;
for x := 200 to 300 do if D15(x) then writeln(x);
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
function k15(a:integer):boolean;
begin
k15:=a mod 15 = 0;
end;
var i: integer;
begin
for i:=200 to 300 do
if k15(i) then write(i,' ');
end.
Результат:
210 225 240 255 270 285 300
Verified answer
var x: integer;
function D15(x: integer) : boolean;
begin
if (x mod 15) = 0 then D15 := true else D15 := false;
end;
begin
for x := 200 to 300 do if D15(x) then writeln(x);
end.