枚举到根号n即可,因为大于根号n的数的平方大于n
#include <bits/stdc++.h>
using namespace std ;
int main ( ) {
int n ;
while ( cin >> n ) {
int f = 0 ;
for ( int i = 2 ; i <= sqrt ( n ) ; i ++ )
if ( n % ( i * i ) == 0 ) {
cout << "Yes" << endl ;
f = 1 ;
break ;
}
if ( !f ) cout << "No" << endl ;
}
return 0 ;
}