求助

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

zy24_2411310102_lky @ 2024-10-09 17:04:07

在本地可以运行,测试全红


by wuyusheng @ 2024-10-09 17:19:53

AC code (球关)

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

by zy24_2411310102_lky @ 2024-10-10 20:18:36

@wuyusheng 谢谢大佬 已关


|