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

m
(Add 8080 Assembly)
m (→‎{{header|Wren}}: Minor tidy)
 
Line 1,000:
=={{header|Wren}}==
{{libheader|Wren-math}}
{{libheader|Wren-seq}}
{{libheader|Wren-fmt}}
<syntaxhighlight lang="ecmascriptwren">import "./math" for Int
import "./seqfmt" for LstFmt
import "/fmt" for Fmt
 
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)
for (chunk in Lst.chunks(results, 7)) Fmt.print("$5d", chunk)
System.print("\nFound %(results.count) such numbers.")</syntaxhighlight>
 
9,476

edits