求助,c++第二,三点wa

P1150 Peter 的烟

Saberrrrrrr @ 2022-06-22 17:55:03

代码


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

by BantM @ 2022-06-22 18:29:11

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

by Saberrrrrrr @ 2022-06-22 18:40:54

解决了,谢谢大佬


by Lucas2024 @ 2022-07-20 18:22:30

@Bant_Metor,你应该错了


|