| ||||||||||
| 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 | |||||||||
我程序这样为什么还是wa ???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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator