| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:wa wa wa Why ?why ?Why?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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator