Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

这样都WA!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!???????

Posted by tzj115 at 2007-09-02 00:54:01 on Problem 1528
//# include <iostream.h>
# include <stdio.h>

int main()
{
	long d;
	long sum;
	
	printf("PERFECTION OUTPUT\n");
	
	scanf("%ld",&d);////
	while(d>0)
	{
		sum=0;
		for(long i=1;i<d;i++)
		{
			if(d%i==0)
				sum+=i;
		}
		if(sum==d)
		{

			printf("%5ld  PERFECT\n",d);
		}
		if(sum>d)
		{

			printf("%5ld  ABUNDANT\n",d);
		}
		if(sum<d && d!=1)
		{
	
		    printf("%5ld  DEFICIENT\n",d);
		}
	
		scanf("%ld",&d);
	}
	printf("END OF OUTPUT\n");
	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator