Ad Code

Responsive Advertisement

579 - Clock Hands

Author: Ismail Hosen

Daffodil International University





Problem Link

//Please follow from main function



#include<stdio.h>





int main()


{


    double h,m,total,i,j;


    while(scanf("%lf:%lf", &h, &m)==2)


    {


        if(h==0 && m==0)


            break;





        i=((h*30)+(m/2));


        j=(m*6);





        total=i-j;





        if(total<0)


            total*=-1;





        if(total>180)


            total=360-total;





        printf("%.3lf\n",total);


    }


    return 0;


}





Post a Comment

0 Comments