任意数求水仙花数
import java.util.*;
public class Sxh {
public static void main(String[] args){
Scanner sc =new Scanner(System.in);
int n,x,sum;
n =sc.nextInt();
sum=0;
x = n;
while(x>0) {
i=x%10;
sum=sum+i*i*i;
x=x/10;
}
if (sum == n) {
System.out.print("是水仙花数");
}else{
System.out.print("不是水仙花数");
}
}
}