为什么80分

P1150 Peter 的烟

L_Bennett @ 2017-09-20 13:31:34

#include <iostream>
using namespace std;
int main ()
{
    long long n,k,d;
    cin>>n>>k;
    d=n/k;
    n=d+n;
    cout<<n;
    return 0;
}

by onepunchman @ 2017-09-28 21:11:49

#include<bits/stdc++.h>
using namespace std;
int main()
{
   int i,n,k,s;
   cin>>n>>k;
   s=0;
   for(i=1;i<=n;i++)
   {
         s++;
         if(s==k&&k!=1)
         {
             n++;
             s=0;
       }
   }
   cout<<n;
   return 0;
}

|