MODULE Semiprime; FROM STextIO IMPORT SkipLine, WriteLn, WriteString; FROM SWholeIO IMPORT ReadInt; VAR N: INTEGER; PROCEDURE FactorsCnt(N: INTEGER): CARDINAL; VAR Count, F, AN: CARDINAL; BEGIN AN := ABS(N); Count := 0; IF AN >= 2 THEN FOR F := 2 TO AN DO WHILE AN MOD F = 0 DO Count := Count + 1; AN := AN DIV F END END END; RETURN Count END FactorsCnt; BEGIN WriteString("Enter an integer: "); ReadInt(N); SkipLine; IF FactorsCnt(N) = 2 THEN WriteString("It is a semiprime.") ELSE WriteString("It is not a semiprime.") END; WriteLn; END Semiprime.