7 solutions
-
0
c
#include <stdio.h> #include <math.h> int main(){ int x,n,j; scanf("%d",&x); int t=x; int cnt=0; int sum=0; while (t != 0) { t /= 10; cnt++; } t=x; j=cnt; do { int a =pow(10, j); int b = t % a; n = b / pow(10, j - 1); sum+=pow(n, cnt); j--; } while (j != 0); printf(x==sum ? "TRUE":"FALSE"); return 0; }
Information
- ID
- 42
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 5
- Tags
- # Submissions
- 991
- Accepted
- 347
- Uploaded By