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,请高手们帮帮小弟吧!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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator