-------------------------------------------
AC代码:
1 import java.util.Scanner; 2 3 public class Main { 4 5 public static void main(String[] args) { 6 7 Scanner sc=new Scanner(System.in); 8 9 while(true){ 10 int n=sc.nextInt(); 11 if(n==0) return; 12 System.out.println(solve(n)?"Yes":"No"); 13 } 14 15 } 16 17 public static boolean solve(int n){ 18 int m=n,s=0; 19 while(m>0){ 20 int t=m%10; 21 s+=t*t*t; 22 m/=10; 23 } 24 return s==n; 25 } 26 27 }