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 wa wa Why ?why ?Why?

Posted by ACFirst at 2010-04-02 16:09:54 on Problem 1528
In Reply To:wa wa wa Why ?why ?Why? Posted by:ACFirst at 2010-04-02 15:10:13
> #include<stdio.h>
> #include<math.h>
> int main()
> {
> int x;
> int i,sum;
> printf("PERFECTION OUTPUT\n");
> while(1){
> scanf("%d",&x);
> if(0==x){printf("END OF OUTPUT\n");break;}
> if(x==1){printf("%5d  DEFICIENT\n",x);continue;}
> sum=0;
> for(i=1;i<=(int)sqrt(x);i++)if(!(x%i))sum+=i;//错这了啦    该死该死
> if(sum==x)printf("%5d  PERFECT\n",x);
> else if(sum>x)printf("%5d  ABUNDANT\n",x);
> else printf("%5d  DEFICIENT\n",x);
> }
> 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