第三个点WAWAAWAWAWA。。。(pascal

P1150 Peter 的烟

TCZN @ 2019-04-03 20:39:05

  n,k,s,i,y:longint;
begin
  read(n,k);
    s:=n;y:=0;
    if n>k then 
   begin
      s:=s+n div k;
      y:=y+n div k;
      if y=k then s:=s+y div k;
   end;
  writeln(s);
end.  

by chen_zhe2 @ 2019-04-27 21:57:54

#include<bits/stdc++.h>
#include<iostream>
#include<fstream>
#include<algorithm>
using namespace std;
long long n,k,m;
int main()
{
    scanf("%d%d",&n,&k);
    m=n;
    for(int i=1;;i++)
    {
         if(m>=k) 
         {
           ++n;
           m-=(k-1);
         }
         if(m<k) break;
    }
    printf("%d",n);

    return 0;
} 

by luo007 @ 2019-06-07 12:50:02

我也是


上一页 |