快乐的数字

a=str(input("3045\n"))
while(a!=1 and a!=4):
    x = list(str(a))
    a=0
    for i in x:
        a=a+int(i)**2
if(a==1):
    print("这个是快乐的数字")
else:
    print("这个不是快乐的数字")

posted @ 2021-09-14 19:24  boyc  阅读(32)  评论(0)    收藏  举报