#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(0)
#define dbug(x) cout<<x<<" "
using namespace std;
int main()
{
//FAST;
int hour , minute ;
double total , h_angle , m_angle;
while(scanf("%d:%d",&hour,&minute)== 2){
if(!hour && !minute)break;
m_angle = minute/5.0*30.0;
h_angle = hour*30.0 + minute*30.0/60.0;
total = fabs(h_angle - m_angle);
if(total > 180.0 ) total = 360.0 - total;
printf("%.3f\n",total);
}
return 0;
}
#define FAST ios_base::sync_with_stdio(0)
#define dbug(x) cout<<x<<" "
using namespace std;
int main()
{
//FAST;
int hour , minute ;
double total , h_angle , m_angle;
while(scanf("%d:%d",&hour,&minute)== 2){
if(!hour && !minute)break;
m_angle = minute/5.0*30.0;
h_angle = hour*30.0 + minute*30.0/60.0;
total = fabs(h_angle - m_angle);
if(total > 180.0 ) total = 360.0 - total;
printf("%.3f\n",total);
}
return 0;
}
No comments:
Post a Comment