Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- while (true) {
- try {
- long n = Long.parseLong(scanner.next());
- System.out.println((sumDiv(n) - n) == n ? "Es número perfecto." : "No es número perfecto");
- break;
- } catch (Exception e) {
- System.out.println("Se introdujo un número inválido, reintente.");
- // main(args);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement