Follows 382.c (Total 25 lines):

/* @JUDGE_ID:4461XX 382 C */
/* A */
# include <stdio.h>
long number,i,child;
void main(void)
{
	printf("PERFECTION OUTPUT\n");
	while(scanf("%ld",&number)==1)
	{
		if (number==0)break;
		child=1;
		for(i=2;i<=(number/2);i++)
		{
			if(number%i==0)
			{
				child=child+i;
			}
		}
		if(number==1)child=0;
		if (child==number)printf("%5ld  PERFECT\n",number);
		else if(child<number)printf("%5ld  DEFICIENT\n",number);
		else printf("%5ld  ABUNDANT\n",number);
	}
	printf("END OF OUTPUT\n");
}

Back to statistics
Ya-Lin Huang (C)
huangyl@gmail.com