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

Re:郁闷啊,明明没错啊,但却WA,请高手们帮帮小弟吧!

Posted by xiaoha at 2005-01-05 15:04:36 on Problem 1528
In Reply To:郁闷啊,明明没错啊,但却WA,请高手们帮帮小弟吧! Posted by:pkueducn1 at 2005-01-03 21:50:45
你也太马虎了吧,还得我又WA了三次,你的PRRFECT应是PERFECT.....................................
答案
#include<stdio.h>
void main(){
	long m,i,sum;
	scanf("%ld ",&m);
	printf("PERFECTION OUTPUT\n");
	while(m>0){
		sum=0;
		for(i=1;i<m;i++)
			if(m%i==0) sum+=i;
		if(m==sum)
			printf("%5d  PERFECT\n",m);
		if(m>sum)
			printf("%5d  DEFICIENT\n",m);
		if(m<sum)
			printf("%5d  ABUNDANT\n",m);
		scanf("%ld ",&m);
	}
	scanf("\n");
	printf("END OF OUTPUT\n");
}

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