yxx051110 @ 2024-04-13 17:55:00
#include<stdio.h>
#include<math.h>
int main()
{
int s,v,t,a,b;
scanf("%d %d",&s,&v);
t=ceil(1.0*s/v);
a=(8*60-10-t)/60;
b=(8*60-10-t)%60;
printf("%02d:%02d",a,b);
return 0;
}
by WMWD @ 2024-04-13 18:17:55
@yxx051110 因为所用时间可能大于
by WMWD @ 2024-04-13 18:19:10
我的代码,不用抄袭(违规紫衫)
#include<bits/stdc++.h>
using namespace std;
int s,v,day=12000,t=480,sum=10;
int main(){
cin>>s>>v;
if(s%v==0) sum+=s/v;
else sum+=s/v+1;
if(sum<=t)
{
t=t-sum;
cout<<0<<t/60<<':';
t=t%60;
if(t<10) cout<<0<<t;
else cout<<t;
}
else{
sum-=480;
sum=sum%(60*24);
t=60*24;
t=t-sum;
if(t<600)
{
cout<<0<<t/60<<':';
t=t%60;
if(t<10) cout<<0<<t;
else cout<<t;
}
else{
cout<<t/60<<":";
t=t%60;
if(t<10) cout<<0<<t;
else cout<<t;
}
}
return 0;
}