package test; |
import java.util.Scanner; |
public class test { |
public static void main(String[] args) { |
Scanner scanner= new Scanner(System.in); |
System.out.println( "enter a number :" ); |
int n=scanner.nextInt(); |
int sum= 0 ; |
for ( int i= 1 ;i<n;i++) |
if (n%i== 0 ) |
sum+=i; |
if (sum==n) |
System.out.println( "是完全数" ); |
else |
System.out.println( "不是完全数" ); |
|
} |
} |