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 16:00, 25 November 2021
, 2 years agono edit summary
(Added Python implementation) |
No edit summary |
||
Line 222:
<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|Ksh}}==
<lang ksh>
#!/bin/ksh
# Positive decimal integers with the digit 1 occurring twice
# # Variables:
#
integer MAX=999
# # Functions:
#
######
# main #
######
for ((i=10; i<MAX; i++)); do
[[ ${i} == *{2}(1)* ]] && printf "%d " ${i}
done
echo</lang>
{{out}}<pre>11 110 111 112 113 114 115 116 117 118 119 211 311 411 511 611 711 811 911
</pre>
|