#3 #5求助

P5707 【深基2.例12】上学迟到

whho_0 @ 2024-01-14 15:05:44

#include<iostream>
using namespace std;
int main() {
    int s, v;
    cin >> s >> v;
    int t = s / v;
    if (s % v != 0) t++;
    int sum = t + 10;
    int hour = sum / 60;
    int minute = sum - hour * 60;
    if (hour < 8)
        cout << 0 << 7 - hour << ":" << 60 - minute;
    if (hour >= 8)
        cout << 24 + 7 - hour << ":" << 60 - minute;
    return 0;
}

|