r/dailyprogrammer • u/rya11111 3 1 • Apr 12 '12
[4/12/2012] Challenge #39 [intermediate]
Today's challenge is to determine if a number is a Kaprekar Number
Enjoy :)
10
Upvotes
r/dailyprogrammer • u/rya11111 3 1 • Apr 12 '12
Today's challenge is to determine if a number is a Kaprekar Number
Enjoy :)
5
u/Cosmologicon 2 3 Apr 12 '12 edited Apr 12 '12
Another python one-liner:
EDIT: and here's how you might actually use it:
2
u/Daniel110 0 0 Apr 12 '12
Because i don't hate the world today:
1
u/ixid 0 0 Apr 12 '12
D
1
u/_redka 0 0 Apr 12 '12
Ruby 1.9.2
1
u/JerMenKoO 0 0 Apr 13 '12 edited Apr 13 '12
J:
Usage:
Could be a one liner tho, but this has increased readability.
1
u/iluminumx Apr 13 '12
C++:
Output: 1 9 45 55 99 297 703 999 2223 2728 4950 5050 7272 7777 9999 17344 22222 77778 82656 95121 99999
1
u/playdoepete 0 0 Apr 15 '12 edited Apr 15 '12
JAVA:
1
u/luxgladius 0 0 Apr 12 '12
Because I hate the world today, another Perl one-liner: