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:52, 25 January 2024
, 3 months ago→{{header|Wren}}: Minor tidy
Not a robot (talk | contribs) (Add 8080 Assembly) |
m (→{{header|Wren}}: Minor tidy) |
||
Line 1,000:
=={{header|Wren}}==
{{libheader|Wren-math}}
{{libheader|Wren-fmt}}
<syntaxhighlight lang="
import "./
System.print("Decimal numbers under 1,000 whose digits include two 1's:")
var results = (11..911).where { |i| Int.digits(i).count { |d| d == 1 } == 2 }.toList
Fmt.tprint("$5d", results, 7)
System.print("\nFound %(results.count) such numbers.")</syntaxhighlight>
|