求助,只有50

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

GREATchen @ 2023-11-18 12:00:29

#include<bits/stdc++.h>
using namespace std;
int cost,start_time,hour,minute;
double s,v;

int main()
{
    cin>>s>>v;
    cost=ceil(s/v)+10;
    if(cost<=480)
    {   start_time=480-cost;
        hour=start_time/60;
        minute=start_time%60;

       if(hour/10==0)printf("0%d:",hour);
       else printf("%d",hour);
       if(minute/10==0)printf("0%d:",minute);
       else printf("%d",minute);
    }

    else
    {   start_time=480+1440-cost;
        hour=start_time/60;
        minute=start_time%60;

       if(hour/10==0)printf("0%d:",hour);
       else printf("%d",hour);
       if(minute/10==0)printf("0%d:",minute);
       else printf("%d",minute);
    }

    return 0;
}

|