求大佬解答什么是#3

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

G7estmoi @ 2024-04-28 11:02:43

#include <stdio.h>

int main() {
    int v,s,H,M,t;
    scanf("%d %d",&s,&v);
    if(s%v==0){
        t=s/v+10;
    }
    else{
        t=s/v+11;
    }
    if(t<=60){
        H=8-1;
        M=60-t;
    }
    else{
        H=7-t/60;
        M=60-t%60;
    }
    printf("0%d:%d",H,M);
    return 0;
}

include <stdio.h>

int main() { int v,s,H,M,t; scanf("%d %d",&s,&v); if(s%v==0){ t=s/v+10; } else{ t=s/v+11; } if(t<=60){ H=8-1; M=60-t; } else{ H=7-t/60; M=60-t%60; } printf("0%d:%d",H,M); return 0;

}

by ikiy_8866 @ 2024-04-29 21:18:34

你这后面得加个"是否加0"的判断否则你这个强制性输出(第二十行printf("0%d:%d",H,M);)做不到题目预期要求


|