求助大佬们/(ㄒoㄒ)/~~只有10分

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

m3o7o2n1 @ 2024-02-03 19:46:34

#include <stdio.h>
int main(){
    int s,v,min,h,hmin,smin;
    scanf("%d %d",&s,&v);
    hmin=ceil(s/v)+10;
    smin=480+24*60-hmin;
    if(smin>=24*60)smin-=24*60;
    h=smin/60;
    min=smin%60;
    if(h<10){
        if(min<10)printf("0%d:0%d",h,min);
        else printf("0%d:%d",h,min);
    }
    else{
        if(min<10)printf("%d:0%d",h,min);
        else printf("%d:%d",h,min);
    }
    return 0;

}

|