/* To read a number from KB and check the given number is perfect or not */
#include< stdio.h>
main()
{
	int n;
	clrscr();
	printf("Enter the number\n");
	scanf("%d",&n);
	perfect(n);
	getch();
}
perfect(int n)
{
	int i,sum=0,temp;
	for(i=1;i< n-1;i++)
	{
		temp=n%i;
		if(temp==0)
		  sum=sum+i;
	}
	if (n==sum)
		printf("%d is perfect",n);
	else
		printf("%d is not perfect",n);
}