其他分享
首页 > 其他分享> > P1150 Peter的烟

P1150 Peter的烟

作者:互联网

#include<stdio.h>

int main()
{
    int n, k;
    while(scanf("%d %d", &n, &k) != EOF)
    {
        int kase = 0;
        int i = 0;
        while(n > 0)
        {
            n--;
            kase++;
            i++;
            if(i == k)
            {
                i = 0;
                n++;
            }
        }
        printf("%d\n", kase);
    }
    return 0;
}

 

标签:main,int,++,while,kase,Peter,P1150
来源: https://www.cnblogs.com/White-Raffard/p/15465161.html