Liboy53_I_HATE_MATH @ 2024-01-27 14:37:22
#include<iostream>
#include<math.h>
using namespace std;
int main(){
int a,b,c,hour=0,min=0;
cin>>a>>b;
c=ceil(((double)a)/b)+10;
min=c%60;
hour=c/60+1;
if(min==0)
{
min+=60;
hour-=1;
}
if(c<480)
{
cout<<"0"<<8-hour<<":";
if(min==60) cout<<"00";
else cout<<60-min;
}
else
{
hour-=8;
if(24-hour<10) cout<<"0";
cout<<24-hour<<":";
if(min==60) cout<<"00";
else cout<<60-min;
}
return 0;
}
不知道为什么#3#5输出比标准多1 求调
by hema111 @ 2024-02-18 20:32:43
我一开始也是,然后发现是分钟没有补成两位。比如提前59分钟,我一开始是07:1,改成07:01就可以了