Jump to content

Positive decimal integers with the digit 1 occurring exactly twice: Difference between revisions

m
→‎{{header|Pascal}}: added pascal creation by sustituting one One
No edit summary
m (→‎{{header|Pascal}}: added pascal creation by sustituting one One)
Line 327:
<pre>Found 27 numbers:
11 101 110 112 113 114 115 116 117 118 119 121 131 141 151 161 171 181 191 211 311 411 511 611 711 811 911</pre>
=={{header|Pascal}}==
==={{header|Free Pascal}}===
<lang pascal>
program OneOne;
const
SUBSTITUTES ='023456789';
ONES = '111';
var
col,idx: integer;
new : string[3];
begin
For col := 1 to 3 do
begin
new := ONES;
For idx := 1 to length(SUBSTITUTES) do
begin
new[col] := SUBSTITUTES[idx];
write(new:4);
end;
writeln;
end;
end.</lang>
{{Out}}
<pre>
011 211 311 411 511 611 711 811 911
101 121 131 141 151 161 171 181 191
110 112 113 114 115 116 117 118 119</pre>
 
=={{header|Perl}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.