codebot @ 2023-12-09 11:22:05
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int s, v, time;
cin >> s >> v;
time = 480 - 10;
time -= ceil(s / v + 1);
if (time / 60 < 10 || time % 60 < 10){
if (time / 60 < 10 && time % 60 >= 10){
cout << "0" << time / 60 << ":" << time % 60 << endl;
}
else if (time / 60 >= 10 && time % 60 < 10){
cout << time / 60 << ":" <<"0"<< time % 60 << endl;
}
else if (time / 60 < 10 && time % 60 < 10){
cout <<"0"<< time / 60 << ":" <<"0"<< time % 60 << endl;
}
}
else if (time / 60 >= 10 && time % 60 >= 10){
cout << time / 60 << ":" << time % 60 << endl;
}
}
by kolayoyo @ 2023-12-14 12:51:40
输入1000 2试试。“由于路途遥远,yyy 可能不得不提前一点出发,但是提前的时间不会超过一天。”如果路途特别远,走的特别慢,会提前到0点以前出发。