int main()
{
char s;
double d,ld,h,m,f=180.00;
while(scanf("%lf %c %lf",&h,&s,&m)!=EOF)
{
if(h==0 && m==0)
{
break;
}
else
{
if(m>h)
{
d=fabs(((11*m)-(60*h))/2);
if(d>f)
{
ld=360-d;
}
else
{
ld=d;
}
}
else if(h>=m)
{
d=fabs(((60*h)-(11*m))/2);
if(d>f)
{
ld=360-d;
}
else
{
ld=d;
}
}
printf("%0.3lf\n",ld);
}
}
return 0;
}
0 comments:
Post a Comment