Jump to content

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

Realize in Minizinc
(Realize in F#)
(Realize in Minizinc)
Line 130:
</pre>
 
=={{header|MiniZinc}}==
<lang MiniZinc>
%Permutations with some identical elements. Nigel Galloway: July 6th., 2021
include "count.mzn";
array [1..3] of var 0..9: N; constraint count(N,1,2);
output [show((N[1]*100)+(N[2]*10)+N[3])]
</lang>
{{out}}
<pre>
110
----------
101
----------
11
----------
211
----------
311
----------
411
----------
511
----------
611
----------
711
----------
811
----------
911
----------
121
----------
131
----------
141
----------
151
----------
161
----------
171
----------
181
----------
191
----------
112
----------
113
----------
114
----------
115
----------
116
----------
117
----------
118
----------
119
----------
==========
Finished in 206msec
</pre>
=={{header|Nim}}==
<lang Nim>import sugar, strutils
2,172

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.