public class PerfectNumberGenerator{
private static int max = 1000;
public static void main(String[] args){
for (int i = 1;i <= max; i++){
if (isPerfect(i)){
System.out.println(String.valueOf(i) + " is perfect.");
}
}
}
public static boolean isPerfect(int n){
int sum = 0;
for (int i = 1; i < n; i++){
if (n%i == 0) sum = sum + i;
}
return (sum == n);
}
}