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 |
这题有什么特殊情况么?Why I got WA?..........program p1528; var n,m:longint; function divisor(n:longint):longint; var i,t:longint; begin t:=1; for i:=2 to round(sqrt(n)) do if n mod i=0 then begin t:=t+i; if i*i<>n then t:=t+n div i; end; divisor:=t; end; begin read(n); writeln('PERFECTION OUTPUT'); while n<>0 do begin write(n:5,' '); m:=divisor(n); if m=n then writeln('PERFECT') else if m>n then writeln('ABUNDANT') else writeln('DEFICIENT'); read(n); end; writeln('END OF OUTPUT'); end. Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator