Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
26
Task/Semiprime/ERRE/semiprime.erre
Normal file
26
Task/Semiprime/ERRE/semiprime.erre
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
PROGRAM SEMIPRIME_NUMBER
|
||||
|
||||
!VAR I%
|
||||
|
||||
PROCEDURE SEMIPRIME(N%->RESULT%)
|
||||
LOCAL F%,P%
|
||||
P%=2
|
||||
LOOP
|
||||
EXIT IF NOT(F%<2 AND P%*P%<=N%)
|
||||
WHILE (N% MOD P%)=0 DO
|
||||
N%=N% DIV P%
|
||||
F%+=1
|
||||
END WHILE
|
||||
P%+=1
|
||||
END LOOP
|
||||
RESULT%=F%-(N%>1)=2
|
||||
END PROCEDURE
|
||||
|
||||
BEGIN
|
||||
PRINT(CHR$(12);) !CLS
|
||||
FOR I%=2 TO 100 DO
|
||||
SEMIPRIME(I%->RESULT%)
|
||||
IF RESULT% THEN PRINT(I%;) END IF
|
||||
END FOR
|
||||
PRINT
|
||||
END PROGRAM
|
||||
Loading…
Add table
Add a link
Reference in a new issue