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

求救啊!!!!!!!!!!屎不过去了 有的数据都测了 没错

Posted by zhanghejia at 2010-12-02 22:53:52 on Problem 1006
var
      n,i,j,k,l,b:longint;
      p,e,d:longint;
begin
readln(p,e,i,d);
while (p<>-1) or (e<>-1) or (d<>-1) or (i<>-1) do
 begin
 b:=d;
 p:=p mod 23;
 e:=e mod 28;
 i:=i mod 33;
 inc(l);
if d<=d div 23*23+p then
  d:=d div 23*23+p
   else
    d:=(d div 23+1)*23+p;
  if d mod 28=e
     then
      begin
      if d mod 33=i
       then begin
       if d=b then
        writeln('Case ',l,':',' ','the next triple peak occurs in ',21252,' days.') else
        writeln('Case ',l,':',' ','the next triple peak occurs in ',d-b,' days.');
            end
        end
    else
      while d<=21252 do
       begin
        inc(d,23);
        if d mod 28=e
         then if d mod 33=i then
          begin
          if d=b then
            writeln('Case ',l,':',' ','the next triple peak occurs
in',21252,' days.') else
           writeln('Case ',l,':',' ','the next triple peak occurs in ',d-b,' days.');
           break;
           end;
        end;
     readln(p,e,i,d);
 end;
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