Numbers divisible by their individual digits, but not by the product of their digits.: Difference between revisions
Content added Content deleted
(Added Quackery.) |
(Added solution for Action!) |
||
Line 107: | Line 107: | ||
936 |
936 |
||
999</pre> |
999</pre> |
||
=={{header|Action!}}== |
|||
<lang Action!>BYTE FUNC Check(INT x) |
|||
BYTE d |
|||
INT tmp,prod |
|||
prod=1 tmp=x |
|||
WHILE tmp#0 |
|||
DO |
|||
d=tmp MOD 10 |
|||
IF x MOD d#0 THEN |
|||
RETURN (0) |
|||
FI |
|||
tmp==/10 |
|||
prod==*d |
|||
OD |
|||
IF x MOD prod=0 THEN |
|||
RETURN (0) |
|||
FI |
|||
RETURN (1) |
|||
PROC Main() |
|||
INT i |
|||
FOR i=1 TO 999 |
|||
DO |
|||
IF Check(i) THEN |
|||
PrintI(i) Put(32) |
|||
FI |
|||
OD |
|||
RETURN</lang> |
|||
{{out}} |
|||
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Numbers_divisible_by_their_individual_digits,_but_not_by_the_product_of_their_digits.png Screenshot from Atari 8-bit computer] |
|||
<pre> |
|||
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> |
|||
=={{header|Ada}}== |
=={{header|Ada}}== |