No older revisions available
No older revisions available
~cpp # -*- coding: cp949 -*-
def reverse(source):
i=0
n=''
r=''
n=source
print n
#print type(n)
for i in range(len(str(n))):
#print len(str(n))-i
n=str(n)
r = r + n[len(str(n))-i-1]
return r
def hap(n):
r=''
r=reverse(n)
r=int(r)
n=int(n)
if decide(n+r) == 1:
#print n+r
return n+r
else:
#print hap(n+r)
return hap(n+r)
def decide(n):
if n == int(reverse(n)):
print '끝났셈!! : ' + n
return 1
if __name__ == '__main__':
n = raw_input('입력하셈 >> ')
print hap(n)