Numbers divisible by their individual digits, but not by the product of their digits.: Difference between revisions

m
(add RPL)
m (→‎{{header|Wren}}: Minor tidy)
(One intermediate revision by one other user not shown)
Line 1,819:
≪ n j DUP SUB STR→ ≫ 'j' 1 n SIZE 1 SEQ <span style="color:grey">@ make list of digits</span>
DUP2 MOD ∑LIST '''THEN''' DROP2 0 '''END'''
ΠLIST MOD SIGN
'''END'''
≫ '<span style="color:blue">GOOD?</span>' STO
 
≪ 1 1000999 '''FOR''' j '''IF''' j <span style="color:blue">GOOD?</span> '''THEN''' j + '''END NEXT''' ≫ EVAL
{{out}}
<pre>
Line 1,961:
=={{header|Wren}}==
{{libheader|Wren-math}}
{{libheader|Wren-seq}}
{{libheader|Wren-fmt}}
<syntaxhighlight lang="ecmascriptwren">import "./math" for Int, Nums
import "./seqfmt" for LstFmt
import "/fmt" for Fmt
 
var res = []
Line 1,976 ⟶ 1,974:
}
System.print("Numbers < 1000 divisible by their digits, but not by the product thereof:")
for (chunk in Lst.chunks(res, 9)) Fmt.printtprint("$4d", chunkres, 9)
System.print("\n%(res.count) such numbers found")</syntaxhighlight>
 
9,479

edits