一直90分 求助!!!

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

ZhangChao24TS103 @ 2024-09-24 11:01:08

第9个测试点一直出错,求助!!!```c

include <stdio.h>

include <math.h>

int main(void) { int s, v, t; t = 0; scanf("%d %d", &s, &v); t = floor(s / v) + 11; int h, m; m = t % 60; h = floor(t/60); int H, M; M = 60 - m; H = 7 - h + floor(M/60); while (H < 0) { H += 24; } printf("%02d:%02d", H, M%60); return 0; }


by lichenxi108 @ 2024-09-24 11:26:29

#include <stdio.h>
#include <math.h>
int main() { 
    int s, v, t;
    scanf("%d%d", &s, &v);
    t = ceil(1.0 * s / v) + 10; 
    int h = t / 60, m = t % 60; 
    int M = 60 - m, H = 7 - h;
    while (H < 0) {
        H += 24;
    }   
    printf("%02d:%02d", H, M);
    return 0; 
}

还有, 用户应当正确地在帖子内容中使用 Markdown 和 LaTeX.


by ZhangChao24TS103 @ 2024-09-24 11:34:28

@lichenxi108 感谢感谢


by Ningoxo @ 2024-09-27 17:03:54

@lichenxi108 这输入470 1,输出的是23:60,这不合理啊。竟然是正确答案。


by lichenxi108 @ 2024-09-28 18:39:13

《脚搓数据》


by lichenxi108 @ 2024-09-28 18:40:56

@Ningoxo

#include <stdio.h>
#include <math.h>
int main() { 
    int s, v, t;
    scanf("%d%d", &s, &v);
    t = ceil(1.0 * s / v) + 10; 
    int h = t / 60, m = t % 60; 
    int M = 60 - m, H = 7 - h;
    while (H < 0) {
        H += 24;
    }   
    printf("%02d:%02d", H + M / 60, M % 60);
    return 0; 
}

|