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

why RE??? 请教大牛~~~

Posted by wanglinggui at 2007-11-24 22:01:05 on Problem 2509
program pku2509(input, output);

VAR sum, n, k: longint;

BEGIN
  while not eof do
    begin
      read(n, k);
      sum:=n;
      
      while n>=k do
        begin
          sum:=sum+ (n DIV k);
          n:= (n MOD k) + (n DIV k) ;
        end;
      writeln(sum);
    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