Positive decimal integers with the digit 1 occurring exactly twice: Difference between revisions
Positive decimal integers with the digit 1 occurring exactly twice (view source)
Revision as of 20:07, 10 August 2022
, 1 year ago→Pascal: replace complicated solution with straightforward implementation working with any dialect of Pascal
(Ada version) |
(→Pascal: replace complicated solution with straightforward implementation working with any dialect of Pascal) |
||
Line 158:
Number 1 occurs twice 1-999: 27
</pre>
''See [[#Pascal|Pascal]]''
=={{header|F_Sharp|F#}}==
Line 199 ⟶ 202:
print</lang>
{{out}}<pre>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|Free Pascal}}==
''See [[#Pascal|Pascal]]''
=={{header|Go}}==
Line 430 ⟶ 436:
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}}==
<lang pascal>program positiveDecimalIntegersWithTheDigit1occurringExactlyTwice(output);
▲==={{header|Free Pascal}}===
var
begin
for
if ord(n mod 10 = 1) + ord(n mod 100 div 10 = 1) + ord(n div 100 = 1) = 2 then
writeLn(n)
▲ begin
end
▲ end;
end.</lang>
=={{header|Perl}}==
|