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

这题有什么特殊情况么?Why I got WA?..........

Posted by xiaobai at 2004-05-13 22:33:13 on Problem 1528
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:
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