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