为何90分???

P1150 Peter 的烟

nbhsy @ 2017-01-07 10:20:38

var
  n,k,g:longint;
begin
  read(n,k);
  g:=n;
  while n div k>0 do
    begin
      n:=n div k;
      g:=g+n;
    end;
  write(g);
end.

by Hcf2002 @ 2017-01-07 10:44:23

新得到的烟还能继续抽啊。


by BFSBFSBFSBFS @ 2017-01-09 23:01:27

@nbhsy 你把一部分不能换的烟蒂都扔掉了.


by nbhsy @ 2017-01-23 10:18:56

AC了!!!!


|