program bai_tap;
var i,d:integer;
begin
d:=0;
for i:= 100 to 999 do
begin
if (i mod 2 = 0) and (i mod 3 = 0) and (i mod 5 = 0 ) then
begin
write(i,' ');
inc(d);
end;
if d = 5 then
begin
d:=0;
writeln;
end;
end;
readln
end.
program bai1;
var a,b,c:longint;
begin
for a:=1 to 9 do
for b:=0 to 9 do
for c:=0 to 9 do
if (((a*100+b*10+c) mod 2=0) and ((a*100+b*10+c) mod 3=0) and ((a*100+b*10+c) mod 5=0)) then write(a*100+b*10+c);
readln
end.
thiếu xuống dòng
thêm ở chỗ if........ then
begin
dem:=0;
write(a*100+b*10+c);
if dem=5 then writeln;