求告知是哪些地方没有考虑到,测试点有三个没过

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

Ginso @ 2024-11-16 14:53:39

#include <stdio.h>

int main() {
    int s,v,totalTime,time,h,m;
    scanf("%d %d",&s,&v);
    if(s%v==0)
    {
        totalTime=s/v+10;
    }
    else
    {
        totalTime=s/v+11;
    }
    time=480-totalTime;
    h=time/60;
    m=time-h*60;
    printf("%02d:%2d",h,m);
    return 0;
}

by YangCheny @ 2024-11-16 18:54:38

变量,u


by yuanyuan_919 @ 2024-11-29 15:14:02

如果HH为负数,需要加24


|