codefashion @ 2024-09-06 00:17:06
#include<stdio.h>
int main()
{
int v, s, t;
scanf("%d %d",&s,&v);
t = 24 * 60 - s / v - 11 + 8 * 60;
printf("%02d:%02d",(t/60)%24,t%60);
return 0;
}
by Hagasei @ 2024-09-06 08:51:16
当 s/v 能除尽的时候会挂。因为你默认了时间比除出来多 1。
by Hagasei @ 2024-09-06 08:56:57
@codefashion
by codefashion @ 2024-09-06 12:47:51
@Hagasei 那要怎么办呢?
by Xiaojunyihao @ 2024-10-13 17:34:42
@codefashion 用ceil