Найти количество простых чисел в промежутке a < p и p<2a . Числа считываются считывается с input.txt и ответ выводится в output.txt — Pascal(Паскаль)

var a,i,j:longint;
b,c:integer;
f:text;
begin
assign(f,'input.txt');
reset(f);
read(f,a);
close(f);
for i:=a+1 to a*2 do begin
for j:=2 to i-1 do
if i mod j=0 then inc(b);
if b=0 then inc(c);
b:=0;
end;
assign(f,'output.txt');
rewrite(f);
write(f,c);
close(f);
end.

Leave a Comment

87 + = 97