horobot @ 2019-11-03 22:02:56
#include <iostream>
using namespace std;
int main()
{
int n, k, sum = 0, num = 0;
cin >> n >> k;
while (n != 0)
{
if (num / k >= 1)
{
num = 0;
n=n + 1;
}
sum = sum + n;
num = num + n % k;
n = n / k;
}
cout << sum;
system("pause");
return 0;
} 28 3输出41没问题啊
by lrc_mttf001 @ 2019-11-23 10:52:18
我就想问,你编译怎么过的?system函数要cstdio头文件,你没有加。
by lrc_mttf001 @ 2019-11-23 10:53:41
还有,你下载了数据吗,标准输出我看了看,应该是九
by fz20181223 @ 2019-12-17 17:08:30
me+too。。。
by 4399点com @ 2020-01-27 16:57:14
+1
by Xun_lzx @ 2020-08-14 21:08:06
你的另一个括号呢。。