80分,#3#5测试不通过,希望得到大佬帮助
查看原帖
80分,#3#5测试不通过,希望得到大佬帮助
1328195
Mddcha楼主2024/4/17 15:31
#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;

}
2024/4/17 15:31
加载中...