CWindup @ 2023-12-18 23:11:42
感觉代码逻辑没什么问题啊 这是为什么```c
#include<stdio.h>
int main()
{
int s, v, m, h = 0, min = 0;
double mm;
scanf("%d %d", &s, &v);
mm = (double)s / v;
if (mm != (int)mm)mm += 1;
m = 480 - 10 - (int)mm;
for (; m >= 60; h++)m -= 60;
min = m;
printf("%02d:%02d", h, min);
return 0;
}
by wuzhirui @ 2023-12-19 13:26:36
1 首先,你需要考虑是否半夜出发; 2 如果用double会丢失精度——用分钟计算会好一些