追赶问题
不能正确输出
```c
#include<stdio.h>
#include<math.h>
int main()
{
int h=0,m=0,s=0;
double d,v1,v2,x1,x2,t,r,o,p,q;
scanf("%lf%lf%lf",&d,&v1,&v2);
scanf("%lf%lf%lf",&o,&p,&q);
x1=v15/18,x2=v15/18;r=1000d;
if(v1>=v2)
printf("None\n");
else
{
double i=3600;
t=r/(x2/x1);
while(t/i!=0)
{
h++;
i=(h+1);
}
t=fmod(t,3600);double j=60;
while(t/j!=0)
{
m++;
j*=(m+1);
}
s=fmod(t,60);
s=s+q;
if(s>=60)
{
s++;
s=fmod(s,60);
}
if(m>=60)
{
h++;
m=m%60;
}
while(h>24)
{
h=h-24;
}
printf("%d:%d:%d\n",h,m,s);
}
return 0;
}
输入样例2
16.56
1.05 2.67
12:36:4.5
输出样例2
22:49:24.50
```a.c: In function ‘main’:
a.c:7:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lf%lf%lf",&d,&v1,&v2);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.c:8:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lf%lf%lf",&o,&p,&q);
^~~~~~~~~~~~~~~~~~~~~~~~~~~