Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions

View file

@ -0,0 +1,37 @@
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.