Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- int a, b, cnt = 0;
- cin >> a >> b;
- int pp, ogl;
- double y;
- int z;
- for (int x = 1; x * x <= b; ++x)
- {
- pp = x * x;
- if (pp >= a)
- {
- ogl = 0;
- while (pp)
- {
- ogl = ogl * 10 + pp % 10;
- pp /= 10;
- }
- y = sqrt(ogl);
- z = y;
- if (z == y) // daca ogl e patrat perfect
- cnt++;
- }
- }
- cout << cnt;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement