Program PRACT11; Uses CRT; Var a, b: Word; i: Word;
Function IsSimple(n: Word): Boolean; Var T: Word; Begin IsSimple := True; T := 2; While (T < n) Do Begin If (n mod T = 0) then Begin IsSimple := False; Break; End Else Inc(T); End; End;
Begin ClrScr; Repeat Write('Введите A и B: '); ReadLn(a,b); Until (b >= a); For i := a to b do Begin If (IsSimple(i)) then Writeln('Простое число: ',i); End; ReadKey; End.