萌新的第二个帖子,70分c语言求助,怎么限制在一天里啊

P5707 【深基2.例12】上学迟到

YgtVictor @ 2023-09-22 23:12:48



int main() {
    int s, v, a, b, c, t;

    scanf("%d%d", &s, &v);

        if (s % v == 0) {
            t = s / v;
        } else {
            t = s / v + 1;
        }

        a = (470 - t) / 60;

        if (t <= 470) {
            c = a;
            b = 470 - t - a * 60;
        } else {
            c = 24 + a;
            b = 470 - t - c * 60 + 8 * 24;
        }

        printf("%02d:%02d", c, b);

    return 0;
}```

by 18771668213gzy @ 2023-10-13 19:37:13

蹲一下


|