请问我的这道题哪错了(80分)?

P1150 Peter 的烟

xsy040924qwe @ 2015-09-12 13:53:00

 var
 a,b,c,d:longint;
 begin
 c:=0;
 readln(a,b);
 d:=a;
while a>=b do begin
    inc(c);
a:=a-b;
end;
write(c+d);
end.

by Gwentpie伪官方 @ 2015-10-30 16:31:40

代码 %AC

[codep ][/covardep]
n,k,y,s:int64;  
begin  
     readln(n,k);  
     s:=n;  
     y:=n;  
     while y>=k do  
     begin  
          inc(s,y div k);  
          y:=(y div k)+(y mod k);  
     end;  
     writeln(s);  
end.

by Gwentpie伪官方 @ 2015-10-30 16:33:51

[codep]

var n,k,y,s:int64;  
begin  
     readln(n,k);  
     s:=n;  
     y:=n;  
     while y>=k do  
     begin  
          inc(s,y div k);  
          y:=(y div k)+(y mod k);  
     end;  
     writeln(s);  
end.[/codep]

by 周楷然 @ 2016-10-05 20:41:56

var
  n,s,k:longint;
begin
  readln(n,k);   s:=n;
  while n>=k do
  begin
   s:=s+n div k;
   n:=n div k+n mod k;
  end;
  writeln(s);
end.

|