看了一下题解,发现是对时间没有处理好,求大佬帮
代码:
#include<iostream>
using namespace std;
int main(){
int s,v,t=0;
cin>>s>>v;
if(s%v==0){
t=s/v+10;
}else{
t=s/v+11;
}
int limit=8*60+24*60;
if(limit>24*60) limit-=24*60;
limit-=t;
int hl=limit/60;
int ml=limit%60;
if(hl<10){
cout<<0<<hl;
}else{
cout<<hl;
}
cout<<":";
if(ml<10){
cout<<0<<ml;
}else{
cout<<ml;
}
return 0;
}