思路

P1150 Peter 的烟

wenwanru @ 2024-06-29 11:24:12

有n根烟, K个烟蒂=一根完整的烟+1个烟蒂, 总数=n+(n-1)/(k-1);


by STA_Morlin @ 2024-07-03 20:20:03

tlqtj


by chenjunchao001 @ 2024-08-13 14:19:11

正确程序是这样的吧

#include<bits/stdc++.h>
using namespace std;
int main(){
    int x=0,n,m;
    cin>>n>>m;
    x=n+(n-1)/(m-1);
    cout<<x;
}

|