Anonymous user
Coprime triplets: Difference between revisions
m
→{{header|REXX}}: simplified code.
(→{{header|REXX}}: optimized and simplified the code.) |
m (→{{header|REXX}}: simplified code.) |
||
Line 114:
if cols>0 then say ' index │'center(@copt, 1 + cols*(w+1) )
if cols>0 then say '───────┼'center("" , 1 + cols*(W+1), '─')
!.= 0; @.= !.;
do #=1
do j=1;
if #<3 then leave
if gcd(j,
end /*j*/
▲ if j>=n then leave /*Have we exceeded the limit? Then quit*/
idx= idx + cols /*bump the index for the output line. */
end /*forever*/
if $\=='' then say center(idx, 7)'│' substr($, 2) /*show any residual output numbers*/
Line 138 ⟶ 139:
/*──────────────────────────────────────────────────────────────────────────────────────*/
commas: parse arg ?; do jc=length(?)-3 to 1 by -3; ?=insert(',', ?, jc); end; return ?
gcd: procedure; parse arg x
{{out|output|text= when using the default inputs:}}
<pre>
|