int x;
while (scanf("%d", &x) != EOF) {
if (x < 1000 && x>99) {
int a = x / 100;
int b = x % 100 / 10;
int c = x % 100 % 10;
if (x == a * a * a + b * b * b + c * c * c)
{
printf("是水仙花数:%d\n", x);
}
else {
printf("不是水仙花数:%d\n", x);
}
}
else {
printf("输入错误,重新输入!\n");
}
}
return 0;
登录后提交答案