Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import acm.program.ConsoleProgram;
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- /**
- *
- * @author prb7
- */
- public class Problema1 extends ConsoleProgram{
- public void run(){
- }
- public boolean isPerfect(int n){
- int suma=1, n_aux=n/2;
- while(n_aux>1){
- if(n_aux>1){
- suma+=n_aux;
- }
- n_aux--;
- }
- return(n==suma);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement