90分是为什么啊大佬们

P1150 Peter 的烟

christinecoco @ 2024-10-18 20:23:40

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main()
{
    int smoke = 0, chang = 0, m=0, stub=0;
    scanf("%d %d", &smoke, &chang);
    m = smoke / chang;
    stub = smoke + m;
    if (m>=chang)
    {
        m = stub / chang;
        stub = smoke + m;
    }
    printf("%d", stub);
    return 0;
}

by Masonyihong @ 2024-10-18 20:32:52

@christinecoco 不止可以换一次


by Panda_01 @ 2024-10-27 14:12:01

假如n=5,k=3,在换过一次后就有3个烟蒂了,就可以再换一个,这个程序输出是6,实际7


by OAOdesunya @ 2024-12-26 09:43:22

@Panda_01@Panda_01谢谢你,原神


|