50分求助qwq

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

修复了前面一天h多一个0的bug,现在80分了qwq
by the_nth_peoplo @ 2024-09-22 00:30:19


@[the_nth_peoplo](/user/1471660) 就是4和7不行
by the_nth_peoplo @ 2024-09-22 00:30:53


@[the_nth_peoplo](/user/1471660) 感觉你的代码很乱,而且这道题不用打这么多代码
by st2010 @ 2024-09-22 01:23:06


@[the_nth_peoplo](/user/1471660) 你的我改不了,但给你看看这个 ```c #include <iostream> using namespace std; int main() { int s, v; int t; int h, m; int hh, mm; cin >> s >> v; t = s / v; if (s % v) { t++; } t += 10; h = t / 60; m = t % 60; hh = 7 - h; mm = 60 - m; while (hh < 0) { hh += 24; } printf("%02d:%02d", hh, mm); return 0; } ```
by st2010 @ 2024-09-22 01:27:04


@[the_nth_peoplo](/user/1471660) 去学一下循环吧
by st2010 @ 2024-09-22 01:30:43


@[st2010](/user/1268831) 有道理
by the_nth_peoplo @ 2024-09-25 15:55:38


|