60分,求大佬解惑

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

ydwide @ 2024-12-04 20:57:16

#include<stdio.h>
int main(){
    int s,v;
    scanf("%d%d",&s,&v);
    float m;
    if(s%v==0){
        m=s/v+10;
    }else{
        m=s/v+1+10;
    }
    float h=m/60;
    int m_=60-(h-(int)h)*60;
    if((int)h>8){
        printf("%d:%d",24+(8-(int)h)-1,(int)m_);
    }else{
        printf("0%d:%d",8-(int)h-1,(int)m_);
    }
    return 0;
}

|