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

Help:为什么是Presentation Error

Posted by Mary at 2006-08-08 10:57:05 on Problem 1581
看看我的程序错那儿了?

program pku1581;
var n,total,timer,time,num,i,j:longint;
    name,mz:string;
    t:char;
    a,b:array[1..4] of integer;
begin
  readln(n);
  total:=-1;
  timer:=0;
  for j:=1 to n do
  begin
    read(t);
    name:='';
    while t<>' ' do
    begin
      name:=name+t;
      read(t);
    end;
    num:=0;
    time:=0;
    for i:=1 to 4 do
    begin
      read(a[i],b[i]);
      if b[i]<>0
      then begin
             inc(num);
             time:=time+b[i]+(a[i]-1)*20;
           end;
    end;
    if (num>total) or ((num=total) and (time<timer))
    then begin
           total:=num;
           mz:=name;
           timer:=time;
         end;
  end;
  write(mz,' ',total,' ',timer);
  writeln;
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