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

Re:pascal中inc(t,a) 和 dec(t,b) 是t=t+a,t=t-b的意思吗?

Posted by xiaol at 2005-10-22 19:16:24 on Problem 1606
In Reply To:我有一个极变态的方法,大家看看,好像是数论推的,因为a,b互质 Posted by:linmeng at 2005-08-07 20:11:07
> program zju1005;
> var
> a,b,t,n:longint;
> begin
> repeat
> readln(a,b,n);
> if b=1 then
>   begin
>   if n=1 then writeln('fill B');
>   writeln('success');
>   continue;
>   end;
> if a=1 then
>   begin
>   for t:=1 to n do
>     begin
>     writeln('fill A');
>     writeln('pour A B');
>     end;
>   writeln('success');
>   continue;
>   end;
> t:=0;
> while t<>n do
>   begin
>   writeln('fill A');
>   writeln('pour A B');
>   inc(t,a);
>   if t>=b then
>     begin
>     dec(t,b);
>     writeln('empty B');
>     writeln('pour A B');
>     end;
>   end;
> writeln('success');
> until eof(input);
> 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