90 第三个点WA

P1150 Peter 的烟

dgy2325129812 @ 2017-10-11 07:12:00

哪里错了?

#include <iostream>
using namespace std;
int main()
{
    int a,b,c,num=0;
    cin>>a>>b;
    num=a;
    c=a;
    while(c>=b)
    {
        c=c/b;
        num=num+c;
    }
    cout<<num;
}
谁有第三个点的测试数据?

by dgy2325129812 @ 2017-10-11 07:12:41

C++


by dgy2325129812 @ 2017-10-11 13:41:48

问题已解决


by zhshh @ 2017-10-18 11:12:13

为什么


by Randle @ 2017-10-21 11:03:55

我也是,数据是10 2,答案是19,但我的是18。难道不是18吗?


by _LiM @ 2017-10-28 08:19:41

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int s,k,sl,sum; 
int main()
{
    cin>>s>>k;
    sum+=s;
    sl=s;
    while(sl>=k)
    {
        sl-=k;
        sum+=1;
        sl+=1;
    }
    cout<<sum;
    return 0;
}
@[Randle](/space/show?uid=36914)  是减不是除

by Randle @ 2017-10-30 20:58:02

@LiM_817 谢谢啦,竟然入门题都不会了,尴尬。


by _LiM @ 2017-10-31 21:18:46

@Randle 太谦虚了,红名DALAO诶


by 快乐的小狮子 @ 2017-12-19 18:13:11

@Randle 你再想想,是19呢哈!


|