Pagini recente » Cod sursa (job #2187248) | Cod sursa (job #2753972) | Cod sursa (job #2435298) | Cod sursa (job #1167371) | Cod sursa (job #642009)
Cod sursa(job #642009)
program info;
var f,g:text;
v:array[1..100000000] of byte;
n,i,aux:integer;
begin
assign (f,'ciur.in'); reset (f);
assign (g,'ciur.out'); rewrite (g);
read (f,n);
for i:=2 to 7 do
begin
if i=2 then
begin
aux:=i;
while aux<=n do
begin
aux:=aux+i;
v[aux]:=1;
end;
end;
if i=3 then
begin
aux:=i;
while aux<=n do
begin
aux:=aux+i;
v[aux]:=1;
end;
end;
if i=5 then
begin
aux:=i;
while aux<=n do
begin
aux:=aux+i;
v[aux]:=1;
end;
end;
if i=7 then
begin
aux:=i;
while aux<=n do
begin
aux:=aux+i;
v[aux]:=1;
end;
end;
end;
for i:=2 to n do
if v[i]=0 then
write (g,i,' ');
close (f);
close (g);
end.