You are on page 1of 1

import javax.swing.

JOptionPane; /* * */ public class PERFECTOS { public static void main(String[] args) { int n = 1, suma, cont=0; do { suma=0; for (int x = 1; x < n; x++) { if (n % x == 0) { suma += x; } } if (n == suma) { cont++; System.out.println("Numero perfecto ==> " + n); } n++; } while (cont < 4); } }

You might also like