90分WA求助大佬

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

AnionicCr @ 2024-10-23 20:40:45

7:Wrong Answer.

wrong answer On line 1 column 1, read 2, expected 0. 反复确认了好几遍,仍未找到扣分点,请大佬赐教```c

#include<stdio.h>
#include<math.h>
int main(void)
{
    int sh=0,sm=0,eh=8,em=0,i=0;
    float v=0,s=0,t=0;
    scanf("%f %f",&s,&v);
    t=ceil(s/v);
    t=t+10;
    if(t>=60)
    {
        i=floor(t/60);
        sh=eh-i-1;
        sm=60-(t-i*60);
        if(sh<=0)
        {sh=24+sh;}
        printf("%02d:%02d",sh,sm);
    }
    else
    {
        sh=eh-1;
        sm=60-t;
        printf("%02d:%02d",sh,sm);
    }
    return 0;
}

by __int1024 @ 2024-10-23 20:42:10

yyy可能从前一天出发


by __int1024 @ 2024-10-23 20:42:20

@AnionicCr


by AnionicCr @ 2024-10-25 09:35:27

@__int1024 谢谢您,过了.错误涉及到60进1和24进0的表示


|