program ukol23; uses crt; const max=10000; var i,j:longint; s:text; je:boolean; begin clrscr; assign(s,'c:\cisla.txt'); rewrite(s); clrscr; writeln(s,'Prvocisla do ',max); {vypise hlavicku souboru} writeln('Program pracuje'); for i:=2 to max do begin {zjistuje podle nedelitelnosti zda} je:=true; {cislo je nebo neni prvocislem } for j:=(i div 2) downto 2 do if (i mod j)=0 then je:=false; if je then write(s,i:5); end; close(s); writeln('-----------------'); writeln('Soubor byl ulozen'); repeat until keypressed; end.