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[200], n;
- cin >> n;
- int d;
- for ( int i = 0; i < n; ++i)
- {
- cin >> a[i];
- d = sqrt(a[i]);
- if ( a[i] == d * d )
- cout << d << ' ' << a[i] << ' ';
- else
- cout << a[i] << ' ';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement