program lab7; uses crt; const mn=22; type setN=set of 1..mn; var startSet,simpleSet:setN; n1,next,i:word; begin clrscr; startSet:=[2..mn]; simpleSet:=[1]; next:=2; while startSet <> [ ] do begin n1:=next; while n1<=mn do begin exclude(startSet,n1); n1:=n1+next; end; include(simpleSet,next); repeat next:=next+1; until(next in startSet) or (next>mn) end; for i:=8 to mn do if i in simpleSet then write(i:8); writeln; readln; end.