zhengfly @ 2024-10-09 16:57:36
#include <stdio.h>
#include <stdlib.h>
#include<math.h>
int main()
{
int s,v,h,m;
scanf("%d%d",&s,&v);
int t=480-10-s/v;
if (t>=0)
{
m=t%60;
h=t/60;
}
else
{
t=t%(24*60)+24*60;
m=t%60;
h=t/60;
}
printf("%02d:%02d",h,m);
return 0;
}
by zhengfly @ 2024-10-09 19:06:08
改了一下,WA8和10,真不知道错哪了,求大佬救救
#include <stdio.h>
#include <stdlib.h>
#include<math.h>
int main()
{
int s,v,h,m;
scanf("%d%d",&s,&v);
int t=480-10-(float)s/v;
if (t>=0)
{
m=t%60;
h=t/60;
}
else
{
t=t%(24*60)+24*60;
m=t%60;
h=t/60;
}
printf("%02d:%02d",h,m);
return 0;
}
@zhengfly