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

我程序这样为什么还是wa ???

Posted by gongyilun at 2005-07-29 09:15:20 on Problem 2509
In Reply To:不是精度不够,是你没考虑到这种情况。 Posted by:tdzl2003 at 2005-07-27 20:58:12
var
 sum,a,k,c:longint;
begin
 while not eof do
  begin
   readln(a,k);sum:=0;c:=0;
   while a>0 do
    begin
     inc(sum,a);
     inc(c,a);
     a:=c div k;
     c:=c mod 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