Perfect square

PHOTO EMBED

Mon Apr 11 2022 18:56:46 GMT+0000 (Coordinated Universal Time)

Saved by @ayushshuklas #c++

#include <bits/stdc++.h>

using namespace std;
bool isp(long double x)
{
    
    if (x >= 0) {
 
        long long sr = sqrt(x);
         
        
        return (sr * sr == x);
    }
    
    return false;
}

int main()
{
    long long int n;
    cin >> n;
    long long int a[n];
    for(long long int i=0;i<n;i++)
    {
    cin >> a[i];
    if(isp(a[i]))
    cout <<a[i]<<" ";
    }
}
content_copyCOPY