80分 #8 #10求助

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

Dz8897 @ 2024-05-17 21:02:28

#include <bits/stdc++.h>
using namespace std ;
int s,v;
int sum=10;
int main(){
    cin>>s>>v;
    sum+=s/v;
    int e=8-ceil(sum/60)-1,o=60-sum%60-1;
    if(s%v==0) o--;
    if(e<0){
        o++;
        while(e<0) e=24+e;
    }
    if(e>=10)
        cout<<e<<":";
    else
        cout<<"0"<<e<<":";

    if(o>=10)
        cout<<o;
    else
        cout<<"0"<<o;
    return 0;
}
//1000 12
//06:26
//1000 1
//15:10
//10000 5
//22:30

by Dz8897 @ 2024-05-17 21:09:38

@Dz8897 没有 if(s%v==0) o--;


|