Question: An integer, after adding 100 to it, it becomes a perfect square number, and adding 168 is another perfect square number. What is the number?
public class example1 {
static boolean f(int n) {
int m=(int) Math.sqrt(n);
return m*m==n;
}
public static void main(String[] args) {
for(int i=1;;i++) {
if(f(i*i-168+100)) {
System.out.println(i*i-168);
break;
}
}
}
}