U E D R , A S I H C RSS

Reverse And Add/김정현

~cpp 
def reverse(a):
    
    for n in range(len(a)):
        if a[n]!=a[len(a)-n-1]:
            return False
    return True

if __name__ == '__main__':
    a=int(raw_input("number? "))

    t=[0]
    
    for n in range(a):
        a=str(raw_input())
        
        t.append(a)
    del t[0]
    for n in range(len(t)):
        a=t[n]
        b=0
        while reverse(a)!=True:
            a=str(int(a)+int(a[::-1]))
            b=b+1
        print b, a
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:27:54
Processing time 0.0085 sec