Positive decimal integers with the digit 1 occurring exactly twice: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: added a 2nd version.) |
m (→{{header|REXX}}: changed a variable name (HI) to lowercase.) |
||
Line 144: | Line 144: | ||
<lang rexx>/*REXX program finds positive decimal integers which contain exactly two ones (1s). */ |
<lang rexx>/*REXX program finds positive decimal integers which contain exactly two ones (1s). */ |
||
parse arg hi cols . /*obtain optional argument from the CL.*/ |
parse arg hi cols . /*obtain optional argument from the CL.*/ |
||
if |
if hi=='' | hi=="," then hi= 1000 /*Not specified? Then use the default.*/ |
||
if cols=='' | cols=="," then cols= 10 /* " " " " " " */ |
if cols=='' | cols=="," then cols= 10 /* " " " " " " */ |
||
w= 10 /*width of a number in any column. */ |
w= 10 /*width of a number in any column. */ |
||
Line 183: | Line 183: | ||
<lang rexx>/*REXX program finds positive decimal integers which contain exactly two ones (1s). */ |
<lang rexx>/*REXX program finds positive decimal integers which contain exactly two ones (1s). */ |
||
parse arg hi cols . /*obtain optional argument from the CL.*/ |
parse arg hi cols . /*obtain optional argument from the CL.*/ |
||
if |
if hi=='' | hi=="," then hi= 1000 /*Not specified? Then use the default.*/ |
||
if cols=='' | cols=="," then cols= 10 /* " " " " " " */ |
if cols=='' | cols=="," then cols= 10 /* " " " " " " */ |
||
w= 10 /*width of a number in any column. */ |
w= 10 /*width of a number in any column. */ |