100 121 144 225 400 441 484 676 900 public class Exercise { public static void main (String[] args) { for (int i = 100; i < 1000; i++ ) if (f (i)) System.out.println (i); } static boolean f (int n) { double d = Math.sqrt (n); if ((int)d != d) return false; int a = n / 100, b = n / 10 % 10, c = n % 10; if (a == b || a == c || b == c) return true; return false; } }