qiuren @ 2024-10-29 15:35:57
#include <stdio.h>
int main()
{
int s, v, arrivalhour, arrivalmin, endmin, beginmin, beginhour;
double travelmin, totaltravel;
scanf("%d %d", &s, &v);
arrivalhour = 8;
arrivalmin = 0;
travelmin = (double)s / v;
totaltravel = travelmin + 10;
endmin = arrivalhour * 60 + arrivalmin;
beginmin = (int)(endmin - totaltravel);
while (beginmin < 0) {
beginmin += 1440;
}
beginhour =(int)(beginmin / 60);
beginmin =(beginmin) % 60;
printf("%02d:%02d\n", beginhour, beginmin);
return 0;
}