胡重阳 @ 2016-01-27 09:12:22
var
i,n,k,j:longint;
begin
readln(n,k);
i:=n div k;
if i<>1 then
j:=n mod k;
n:=i+n+j;
writeln(n);
end.
by Romeolong @ 2016-01-27 19:18:17
var i,j,k,x,t:longint;
begin
readln(x,k);
t:=x;
while x>=k do //得用循环!
begin
i:=x mod k;
x:=x div k;
t:=t+x;
x:=x+i;
end;
writeln(t);
end.
//自己琢磨吧
by 胡重阳 @ 2016-01-27 23:30:01
谢谢啦