90分,第九点一直没过,求DALAO指点

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

```cpp #include<bits/stdc++.h> using namespace std; double s=0.0,v=0.0; int h,m; int main() { cin>>s>>v; m=10+ceil(s/v); h=ceil(m*1.0/60); m=60-m%60; h=8-h; if(h<0) h=24+h; if(h<10) cout<<"0"; cout<<h<<":"; if(m<10) cout<<"0"; cout<<m; return 0; } ```
by JI_CI @ 2022-10-04 20:05:58


(路过)
by JI_CI @ 2022-10-04 20:06:26


@[bai_yu](/user/782733) 这是c++吗?还没学[笑哭]
by fightclub @ 2022-10-04 20:57:07


(严肃)差不多
by JI_CI @ 2022-10-04 21:11:40


```c #include <bits/stdc++.h> using namespace std; int main() { int a, b; scanf("%d %d", &a, &b); int m = ceil((double)a / (double)b + 10); int start_time = (24 + 8) * 60 - m; int th = 24 * 60; if (start_time > th) { start_time -= th; } int hh = start_time / 60; int mm = start_time % 60; printf("%02d:%02d\n", hh, mm); return 0; } ```
by xiaoqing123456 @ 2022-10-05 11:32:26


路过
by liyuncheng @ 2022-10-06 14:33:01


|