Anonymous user
Distinct power numbers: Difference between revisions
m
→{{header|REXX}}: simplified the code.
(Added Go) |
m (→{{header|REXX}}: simplified the code.) |
||
Line 59:
=={{header|REXX}}==
<lang rexx>/*REXX pgm finds and displays distinct power integers: a^b, where a and b are 2≤both≤5*/
parse arg
if
if hi=='' | hi=="," then hi= 5 /* " " " " " " */
if cols=='' | cols=="," then cols= 10 /* " " " " " " */
Line 77 ⟶ 76:
found= 0; idx= 1 /*initialize # distinct power integers.*/
$= /*a list of distinct power integers. */
do j=0 for mx+1;
found= found + 1; c= commas(j) /*maybe add commas to the number. */
$= $ right(c, max(w, length(c) ) ) /*add a distinct power number ──► list.*/
|