5 solutions
-
0
#include<stdio.h> #include<math.h>
int main() { //如何判断是否为水仙花数? int x,y,z; int judger1, judger2; scanf_s("%1d%1d%1d",&x,&y,&z); judger1 = pow(x,3) + pow(y,3) + pow(z,3); judger2 = x * 100 + y * 10 + z * 1;
if (judger1 == judger2) { printf("True"); } else if (judger1 != judger2) { printf("False"); }; return 0;
}
Information
- ID
- 42
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 5
- Tags
- # Submissions
- 883
- Accepted
- 310
- Uploaded By