Two identical strings: Difference between revisions

Added XPL0 example.
(Added XPL0 example.)
Line 2,909:
 
Found 30 numbers.
</pre>
 
=={{header|XPL0}}==
<lang XPL0>proc BinOut(N); \Output N in binary
int N, Rem;
[Rem:= N&1;
N:= N>>1;
if N then BinOut(N);
ChOut(0, Rem+^0);
];
 
int H, N, M;
[for H:= 1 to 31 do
[N:= H; M:= H;
while M do
[N:= N<<1; M:= M>>1];
N:= N+H;
if N < 1000 then
[IntOut(0, N);
Text(0, ": ");
BinOut(N);
CrLf(0);
];
];
]</lang>
 
{{out}}
<pre>
3: 11
10: 1010
15: 1111
36: 100100
45: 101101
54: 110110
63: 111111
136: 10001000
153: 10011001
170: 10101010
187: 10111011
204: 11001100
221: 11011101
238: 11101110
255: 11111111
528: 1000010000
561: 1000110001
594: 1001010010
627: 1001110011
660: 1010010100
693: 1010110101
726: 1011010110
759: 1011110111
792: 1100011000
825: 1100111001
858: 1101011010
891: 1101111011
924: 1110011100
957: 1110111101
990: 1111011110
</pre>
772

edits