Âûâåñòè êâàäðàòû ïðîñòûõ ÷èñåë îò 1 äî N

 

Uses CRT;

Var I,J,N : Word;

    F : Boolean;

 

Begin

     ClrScr;

     Write ('Ââåäèòå íàòóðàëüíîå ÷èñëî îò 1..256 ');

     ReadLn(N);

 

     For J := 1 To N Do

     Begin

          F := True;

          For I := 2 To Trunc(J/2) Do

          Begin

                If Round(J/I)*I = J Then F := False;

          End;

          If F Then Write(J*J:8);

     End;

     ReadLn;

 

End.