F.py 175 B

1234567891011
  1. while True:
  2. n=int(input())
  3. if n==0: break
  4. a=n//100
  5. b=(n//10)%10
  6. c=n%10
  7. m=a**3+b**3+c**3
  8. if n==m:
  9. print("Yes")
  10. else:
  11. print("No")