80分,#3#5测试不通过,希望得到大佬帮助

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

Mddcha @ 2024-04-17 15:31:29

#include<bits/stdc++.h>
using namespace std;

int main() {

        float s, v;
        cin >> s >> v;
        float t1 = ceil(s / v); /*上取整*/ 
        float time = 24 * 60 - 10 - t1;
        int k = time / 60;
        if ((k + 8) < 10) {
            if(floor(time-60*k)<10) cout << '0' << k + 8 << ':' <<'0'<< floor(time - 60 * k) << endl;
            cout << '0' << k + 8 << ':' << floor(time - 60 * k) << endl;
        }
         if ((k + 8) < 24&&(k+8)>=10) {
            if (floor(time - 60 * k) < 10) cout << k + 8 << ':' << '0' << floor(time - 60 * k) << endl;
            cout<<k + 8 << ':' << floor(time - 60 * k) << endl;
        }
        if ((k + 8) >= 24) {
            if (floor(time - 60 * k) < 10) cout << '0' << k + 8 -24<< ':' << '0' << floor(time - 60 * k) << endl;
            cout << '0' << k + 8 - 24 << ':' << floor(time - 60 * k) << endl;
        }
        return 0;

}

|