num=eval(input()) while num!=1: num=pow((num//100),2)+pow((num%100)//10,2)+pow((num%10),2) print("happy") else: print("输入格式错误")
num=eval(input()) while num!=1: num=pow((num//100),2)+pow((num%100)//10,2)+pow((num%10),2) print("happy") else: print("输入格式错误")
转载于:https://www.cnblogs.com/zsny/p/8718953.html