Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- void SolvePB()
- {
- int n, v[100];
- cin >> n;
- for (int i = 0; i < n; i++)
- cin >> v[i];
- cout << "patrate perfecte:" << endl;
- for (int i = 0; i < n; i++)
- if (sqrt(v[i]) == floor(sqrt(v[i])))
- cout << v[i] << ' ';
- }
- int main()
- {
- SolvePB();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement