70分,求调

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

Wzz041920 @ 2024-11-01 21:01:24

七十分,不知道哪错了

#include <bits/stdc++.h>
using namespace std;
int main ()
{
    int s, v, m = 0, h = 0, ansm = 0, ansh = 0;
    cin >> s >> v;
    if (s / v == 0)
    {
        m = s / v;
    }
    else
    {
        m = s / v + 1;
    }
    m += 10;
    while(m != 0)
    {
        if (m / 60 > 0)
        {
            h ++;
            m -= 60;
        }
        else
        {
            break;
        }
    }
    if (h >= 8)
    {
        ansh = 24 + 8 - h - 1;
    }
    else 
    {
        ansh = 8 - h - 1;
    }
    ansm = 60 - m;
    if (ansm < 10)
    {
        cout << ansh << ":" << 0 << ansm;
    }
    else if (ansh < 10)
    {
        cout << 0 <<  ansh << ":" << ansm;
    }
    else
    {
        cout << ansh << ":" << ansm;
    }
    return 0;
}

by hys20120406 @ 2024-11-05 15:12:23

666 测了那么多遍还是错的?


by Wzz041920 @ 2024-11-08 18:30:03

@hys20120406 太菜了


by hys20120406 @ 2024-11-08 18:39:08

@Wzz041920 555nizaizuangshenm?


|