Uses crt;
Var n,i,a : integer;
Begin
a:=0;
Write('nhap n'); readln(n);
For i:=1 to n do
If (i mod 3= 0) then inc(a);
Writeln('so so chia het cho 3 la',a);
Readln
End.
program oken;
uses crt;
var n,i,dem:integer;
begin
clrscr;
write('nhap so n: '); readln(n);
for i:=1 to n do
if (i mod 3=0) then
begin
write(i,' ');
dem:=dem+1;
end;
writeln;
if dem=0 then
writeln('tu 1 den ',n,' khong co so chia het cho 3.')
else
writeln('co ',dem,' so chia het cho 3.');
readln;
end.
Uses crt;
Var n,i,a : integer;
Begin
a:=0;
Write('nhap n'); readln(n);
For i:=1 to n do
If (i mod 3= 0) then inc(a);
Writeln('so so chia het cho 3 la',a);
Readln
End.
program oken;
uses crt;
var n,i,dem:integer;
begin
clrscr;
write('nhap so n: '); readln(n);
for i:=1 to n do
if (i mod 3=0) then
begin
write(i,' ');
dem:=dem+1;
end;
writeln;
if dem=0 then
writeln('tu 1 den ',n,' khong co so chia het cho 3.')
else
writeln('co ',dem,' so chia het cho 3.');
readln;
end.
uses crt;
var i:integer;
begin
clrscr;
for i:=1 to 20 do
if i mod 3=0 then write(i:4);
readln;
end.