Munchausen numbers: Difference between revisions

Content added Content deleted
m (→‎version 2: changed highlighting, used a template for the output section.)
m (→‎version 3: added highlighting, also used a template for the output section.)
Line 1,897: Line 1,897:


===version 3===
===version 3===
It is about 3 times faster than version 1.
It is about   '''3'''   times faster than REXX version 1.
<lang rexx>/*REXX program finds and displays Münchhausen numbers from one to a specified number (Z)*/
<lang rexx>/*REXX program finds and displays Münchhausen numbers from one to a specified number (Z)*/
@.=0; do i=1 for 9; @.i=i**i; end /*precompute powers for non-zero digits*/
@.=0; do i=1 for 9; @.i=i**i; end /*precompute powers for non-zero digits*/
Line 1,913: Line 1,913:
end /*while*/
end /*while*/
return $==ox /*it is or it ain't*/</lang>
return $==ox /*it is or it ain't*/</lang>
'''output''' &nbsp; is the same as the 2<sup>nd</sup> REXX version. <br><br>
{{out|output|text=&nbsp; is the same as the 2<sup>nd</sup> REXX version. <br><br>


=={{header|Ring}}==
=={{header|Ring}}==