#3WA,DALAO求助
查看原帖
#3WA,DALAO求助
760418
not_exist楼主2022/8/26 13:02
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef string sg;
typedef long lg;
typedef double de;
typedef char ch;
typedef long long ll;
typedef bool bl;
typedef unsigned int ui;
typedef unsigned long long ull;

int main()
{
	ll num=0,n,k;
	cin>>n>>k;
	while(n>=k){
		num+=n;
		n=(n/k);
	}
	num+=n;
	cout<<num;
	return 0;
}
2022/8/26 13:02
加载中...