70分求助

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

JZJZJZJZJZ @ 2024-07-01 19:48:57

70分求助

#include <iostream>
#include <cstdio>
#include<stdio.h>
using namespace std;

int main ()
{
    int s,v,time1,t3,t2;
    cin>>s>>v;
    time1=s/v+10;
    t3=time1/60;
    t2=59-time1%60;
    t3=7-t3;
    if(s>v*24*60){
        cout<<"0:00";
    }
    else{
        printf("%02d:%02d",t3,t2);

    }   

    return 0;
}

by pi3_141592653589 @ 2024-07-05 21:09:47

@JZJZJZJZJZ 我就曾经70分过,你得特判一下h小于零的情况。


|