80分求助。

P1150 Peter 的烟

ACGDC123 @ 2022-07-10 17:57:21

下面是代码:

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k,a;
    cin>>n>>k;
    a=n+floor(n/k);
    cout<<a;
    return 0;
}

by JASONYAN @ 2022-07-13 21:44:55

Please transform the content in line 6 into

a=n+(int)(floor((n-1)/(k-1));

|