Advertisement
STANAANDREY

subp pp

Dec 10th, 2019
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. void SolvePB()
  6. {
  7.     int n, v[100];
  8.     cin >> n;
  9.     for (int i = 0; i < n; i++)
  10.         cin >> v[i];
  11.  
  12.     cout << "patrate perfecte:" << endl;
  13.     for (int i = 0; i < n; i++)
  14.         if (sqrt(v[i]) == floor(sqrt(v[i])))
  15.             cout << v[i] << ' ';
  16. }
  17.  
  18. int main()
  19. {
  20.     SolvePB();
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement