Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- #include <math.h>
- using namespace std;
- int main()
- {
- int bufer = 0;
- int a, b, c, _b, _c, _d, _e, _f;
- for (a = 0; a < 10; a++)
- {
- for (b = 0; b < 10; b++)
- {
- if (a == b) continue;
- for (c = 0; c < 10; c++)
- {
- if (b == c) continue;
- bufer = a*100 + b*10 + c;
- bufer *= bufer;
- if (bufer > 99999)
- {
- continue;
- }
- // abc * abc = defbc
- _c = bufer % 10;
- _b = bufer / 10 % 10;
- _f = bufer / 100 % 10;
- _e = bufer / 1000 % 10;
- _d = bufer / 10000;
- if (b == _b && c == _c)
- {
- if (c != b &&
- _b != _c && _b != _f && _b != _e && _b != _d &&
- _c != _f && _c != _e && _c != _d &&
- _f != _e && _f != _d &&
- _e != _d)
- {
- printf("result = %d\n", (int)sqrt(bufer));
- }
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement