package com.company;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter the Number: ");
int n = in.nextInt();
int a = n;
int rem = 0;
for ( int i = 1; i < n; i++){
if( n % i == 0){
rem = rem + i;
}
}
if (rem == a){
System.out.println("YES");
}
else {
System.out.println("NO");
}
}
}
For further actions, you may consider blocking this person and/or reporting abuse
Discussion (0)