90分求解
查看原帖
90分求解
1319917
Mark_cy楼主2025/2/6 15:01
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n,k,d = 0,c = 0;
	cin >> n >> k;
	while (n > 0 || d > k){
		d = n;
		c += d;
		n = 0;
		n += d / k;
		d %= k;
	}
	cout << c;
	return 0; 
}
2025/2/6 15:01
加载中...