求助大佬,0分

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

yufan_Arvin @ 2024-09-17 12:52:37

#include<bits/stdc++.h>
using namespace std;
double s,v;
int time_all,hour,time_use,minute;
int main()
{
    cin>>s>>v;
    time_all=8*60+24*60;
    time_use=ceil(s/v)+10;
    time_all-=time_use;
    if(time_all>=24*60) time_all-=24*60;
    hour=time_all%60;
    minute=time_use/60;
    if(hour<10)
    {
        if(minute<10) cout<<"0"<<hour<<":0"<<minute;
        else cout<<"0"<<hour<<":"<<minute;
    }
    else
    {
        if(minute<10) cout<<hour<<":0"<<minute;
        else cout<<hour<<":"<<minute;
    }
    return 0;
}

|