uses crt;
var n,i,kt,j,dem:integer;
begin
clrscr;
repeat
write('Nhap n='); readln(n);
until n<1000;
dem:=0;
for i:=2 to n do
begin
kt:=0;
for j:=2 to i-1 do
if i mod j=0 then kt:=1;
if kt=0 then inc(dem);
end;
writeln('So luong so nguyen to trong khoang tu 1 toi ',n,' la: ',dem);
readln;
end.
Đúng 0
Bình luận (0)