995

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

jinjideqingyin @ 2024-07-13 11:22:53


by Maisie586_ @ 2024-07-13 11:54:52

@jinjideqingyin 求关

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

|