不知道哪里错了,大佬们帮忙看看

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

ac代码参考一下: ```c #include<bits/stdc++.h> #include <bits/stdc++.h> using namespace std; int s,v,h,m,zsj,sd; int main(){ cin>>s>>v; sd=ceil((double)s/(double)v); zsj=8*60+24*60-ceil(sd)-10; h=zsj/60%24; m=zsj%60; if(h<10&&m<10) cout<<0<<h<<":"<<0<<m; if(h<10&&m>=10) cout<<0<<h<<":"<<m; if(h>=10&&m<10) cout<<h<<":"<<m; if(h>=10&&m>=10) cout<<h<<":"<<m; return 0; } ```
by dsfgsdf @ 2023-07-14 17:28:08


@[aikyon_lz2022](/user/763794) 你的11.12.13.14行代码,可能不对,只要在判断小时的时候%24就能解决提前出发的问题了!
by dsfgsdf @ 2023-07-14 17:34:49


@[lfxxzms](/user/1003851) 谢谢
by aikyon_lz2022 @ 2023-07-14 20:28:05


|