import java.util.*;
import java.math.*;
//tc; rename the class name before submitting
public class SemiPerfectSquare {
public static void main(String[] args) {
SemiPerfectSquare obj = new SemiPerfectSquare();
System.out.println(
obj.check(
5
));
}
public String check(int N) {
int n = (int) Math.sqrt(N);
boolean yes = false;
for (int i = 2; i <= n; i++) {
int i2 = i * i;
for (int j = 1; j < i; j++) {
if (j * i2 == N)
yes = true;
}
}
if (yes)
return "Yes";
else
return "No";
}
}
No comments:
Post a Comment