U E D R , A S I H C RSS

Reverse And Add/조현태

~cpp 

def back (num):
    num=str(num)
    sub_um=num[::-1]
    return int(sub_um)
def cal(number):
    j=0
    while number!=back(number):
        number=number+back(number)
        j=j+1
    print j,' ',
    return number

if __name__ == '__main__':
    t= int (raw_input('숫자를 입력해주세요>>'))
    i=t
    target=[] 
    while i>0:
        a=int (raw_input('>>'))
        target.append(a)
        i=i-1
    i=0
    while i!=t:
        print cal (target[i])
        i=i+1
 
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:27:55
Processing time 0.0047 sec