70分求助

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

```cpp #include<bits/stdc++.h> using namespace std; int s,v,cnt,h,sum; int main() { cin >> s >> v; if(s%v==0) cnt=s/v; else cnt=s/v+1; cnt+=10; if(cnt<=60) { if(60-cnt<10) cout << "07:0" << 60-cnt; else cout << "07:" << 60-cnt; } else { if(cnt%60==0) h=cnt/60; else h=cnt/60+1; if((8-h)<0) { if(h%8==0) sum=h/8; else sum=h/8+1; if(60-cnt%60==60) cout << ((8+sum*24)-h)%24+1 << ":00"; else { if(60-(cnt%60)<10) cout << ((8+sum*24)-h)%24 << ":0" << 60-(cnt%60); else cout << ((8+sum*24)-h)%24 << ":"<<60-(cnt%60); } } else { if(60-(cnt%60)<10) cout << "0" << 8-h << ":0" << 60-(cnt%60); else cout << "0" << 8-h << ":" << 60-(cnt%60); } } return 0; } ``` @[xiahaihan](/user/1403233)
by _luogu_huowenshuo_ @ 2024-09-28 08:06:04


@[_luogu_huowenshuo_](/user/884813) 谢谢,已关
by xiahaihan @ 2024-09-28 08:39:50


|