Jasper111 @ 2024-10-24 16:51:48
代码
#include<bits/stdc++.h>
using namespace std;
int s,v;
int h,m;
int main()
{
cin>>s>>v;
int ti_me=ceil(s*1.0/v);
h=7,m=50;
if(ti_me<=50)
{
printf("%02d:%02d",h,m-ti_me);
return 0;
}
if(ti_me<=470)
{
int x=ti_me/60;
ti_me-=x*60;
printf("%02d:%02d",h-x,m-ti_me);
return 0;
}
ti_me%=1910;
h=23,m=60;
ti_me-=470;
int x=ti_me/60;
ti_me-=x*60;
printf("%02d:%02d",h-x,m-ti_me);
return 0;
}
by tyr_04 @ 2024-10-24 16:58:21
@Jasper111 大概看了一下,在第二个 if
语句里面,ti_me
的值可能会大于
by Jasper111 @ 2024-10-24 18:56:46
@tyr_04 AC了谢谢!