Kaprekar numbers: Difference between revisions
Content added Content deleted
m (→{{header|Wren}}: Minor tidy) |
(Added Easylang) |
||
Line 2,012: | Line 2,012: | ||
</syntaxhighlight> |
</syntaxhighlight> |
||
=={{header|EasyLang}}== |
|||
<syntaxhighlight> |
|||
func karp n . |
|||
h = n * n |
|||
e = 1 |
|||
while h > 0 |
|||
t += h mod 10 * e |
|||
e = e * 10 |
|||
h = h div 10 |
|||
if t > 0 and h + t = n |
|||
return 1 |
|||
. |
|||
. |
|||
. |
|||
for i to 9999 |
|||
if karp i = 1 |
|||
write i & " " |
|||
. |
|||
. |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
1 9 45 55 99 297 703 999 2223 2728 4879 4950 5050 5292 7272 7777 9999 |
|||
</pre> |
|||
=={{header|Elixir}}== |
=={{header|Elixir}}== |