80分,#3#5未过,求救

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

Lamine_Linrui @ 2024-02-24 11:42:25

#include<bits/stdc++.h>
using namespace std;
int main(){
    int s,v;
    cin>>s>>v;
    int t=ceil(s*1.0/v);
    t+=10;
    int h=floor(t/60.0);
    int m=60-(t-h*60);
    h=7-h;
    if(h<0)h=24+h;
    if(h<10)cout<<0;
    cout<<h;
    cout<<":";
    cout<<m;
    return 0;
}

by zzh3050426589 @ 2024-02-26 19:22:28

蹲一手


by Panwenni123 @ 2024-02-26 21:09:28

#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;
}

by Panwenni123 @ 2024-02-26 21:10:40

你自己琢磨吧!


|