| ||||||||||
| 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 | |||||||||
求你们了!!!!!我哪里错了??帮帮忙吧!!!!!(第1006)In Reply To:求你们了!!!!!我哪里错了??帮帮忙吧!!!!!(第1006) Posted by:3sandejiu at 2009-05-01 07:36:58 > Program p1006;
> Const
> infile = 'p1006.in';
> outfile = 'p1006.out';
> Var
> n, p, e, i, d, j: Longint;
> Begin
> Assign(input, infile);
> Assign(output, outfile);
> Reset(input);
> Rewrite(output);
> n:=0;
> Readln(p, e, i, d);
> While not ((p=-1) and (e=-1) and (i=-1) and (d=-1)) Do Begin
> Inc(n);
> For j:=0 To 644 Do
> If (i+33*j-p>=0) and (i+33*j-e>=0) and ((i+33*j-p) mod 23 = 0) and ((i+33*j-e) mod 28=0) Then Break;
> while i+33*j-d<=0 Do j:=j+644;
> Writeln('Case ', n, ': the next triple peak occurs in ', i+33*j-d, ' days.');
> Readln(p, e, i, d);
> End;
> Close(input);
> Close(output);
> End.
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator