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

我也是Pascal,注意一下输入>>

Posted by zdker at 2005-07-27 14:41:22 on Problem 2509
In Reply To:Help Problem D Posted by:My_loves at 2005-07-27 14:33:24
> 没想法了。这种题目都会WA!
> 帮我看看。是不是我理解错了
> 
> program p2509;
>  var n,k:integer;
>      out:longint;
> 
>  procedure main;
>   var i,j,butt:integer;
>   begin
>    out:=n;
>    butt:=n;
>    repeat
>     out:=out+butt div k;
>     butt:=butt mod k +butt div k;
>    until butt<k;
>   end;
> 
>  begin
>   repeat
>    readln(n,k);
>    if n=0 then halt;
>    main;
>    writeln(out);
>   until eof;
>  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