1 solutions
-
0
C :
#include<stdio.h> #include<math.h> int main() { int a,b,c,d; for(a=1;a<=9;a++) { for(b=0;b<=9;b++) { c = a*1000+a*100+b*10+b; d = sqrt(c); if(d*d==c) { if(a==b) break; printf("%d\n",c); } } } }C++ :
#include<stdio.h> int main() { int a,b,c,d,n,m; for(n=33;n*n<=9988;n++) { m = n*n; a = m/1000; b = (m-a*1000)/100; c = (m-a*1000-b*100)/10; d = m%10; if(a==b&&c==d&&a!=c) printf("%d\n",m); } return 0; }
- 1
Information
- ID
- 17328
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By