Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<cmath>
- using namespace std;
- bool provjera(int);
- int main()
- {
- int n = 999;
- for (int i = 100; i <= n; i++)
- {
- if (provjera(i) == true)
- cout << i << endl;
- }
- system("PAUSE");
- return 0;
- }
- bool provjera(int n)
- {
- int pohrana, x, x1, y, broj;
- pohrana = n % 10;
- x = pohrana*pohrana;
- broj = n / 10;
- x1 = sqrt(broj);
- y = x1 - x;
- if (y == n)
- {
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment