#include <stdio.h>
float min(float x,float y){
if(x>y)
return y;
return x;
}
float abs(float x,float y){
if(x>y)
return x-y;
return y-x;
}
int main()
{ int x,y;
while(1){
scanf("%d:%d",&x,&y);
if(x==0 && y==0)
break;
if(x>11)
x-=12;
float secondangle=(float) (y*6.0);
float firstangle=(float) (x*(30.0)+30.0*(y/60.0));
float ans=abs(firstangle,secondangle);
ans=min(360-ans,ans);
printf("%.3f\n",ans);
}
return 0;
}
float min(float x,float y){
if(x>y)
return y;
return x;
}
float abs(float x,float y){
if(x>y)
return x-y;
return y-x;
}
int main()
{ int x,y;
while(1){
scanf("%d:%d",&x,&y);
if(x==0 && y==0)
break;
if(x>11)
x-=12;
float secondangle=(float) (y*6.0);
float firstangle=(float) (x*(30.0)+30.0*(y/60.0));
float ans=abs(firstangle,secondangle);
ans=min(360-ans,ans);
printf("%.3f\n",ans);
}
return 0;
}
No comments:
Post a Comment