Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4. int main()
  5. {   
  6. int a[200], n;   
  7. cin >> n;   
  8. int d;   
  9. for ( int i = 0; i < n; ++i)   
  10. {       
  11. cin >> a[i];       
  12. d = sqrt(a[i]);       
  13. if ( a[i] == d * d )           
  14. cout << d << ' ' << a[i] << ' ';       
  15. else           
  16. cout << a[i] << ' ';   
  17. }   
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement