Numbers divisible by their individual digits, but not by the product of their digits.: Difference between revisions
Numbers divisible by their individual digits, but not by the product of their digits. (view source)
Revision as of 08:35, 9 April 2021
, 3 years agoAdd Snobol
Not a robot (talk | contribs) (Add 8086 assembly) |
Not a robot (talk | contribs) (Add Snobol) |
||
Line 607:
</pre>
=={{header|Snobol}}==
<lang snobol> define('divis(n)i,d,p') :(divis_end)
divis p = 1
i = n
digit d = remdr(i,10)
p = ne(d,0) eq(remdr(n,d),0) p * d :f(freturn)
i = gt(i,9) i / 10 :s(digit)
ne(remdr(n,p)) :s(return)f(freturn)
divis_end
n = 1
loop output = divis(n) n
n = lt(n,1000) n + 1 :s(loop)
end</lang>
{{out}}
<pre style='height:50ex;'>22
33
44
48
55
66
77
88
99
122
124
126
155
162
168
184
222
244
248
264
288
324
333
336
366
396
412
424
444
448
488
515
555
636
648
666
728
777
784
824
848
864
888
936
999</pre>
|