Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int H,M;
- char ch;
- float a,b,c,d,e,f;
- while(scanf("%d%c%d",&H,&ch,&M)!=EOF)
- {
- if(H==0 && M==0)
- break;
- a=H*60;
- b=a+M;
- c=b*.5;
- d=M*6;
- if(c>d)
- {
- e=c-d;
- }
- else
- {
- e=d-c;
- }
- if(e>180)
- {
- f=360-e;
- printf("%.3f\n",f);
- }
- else if(e<=180)
- {
- printf("%.3f\n",e);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment