-
Notifications
You must be signed in to change notification settings - Fork 2
/
1125.txt
43 lines (32 loc) · 848 Bytes
/
1125.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <cstdlib>
#include <iostream>
#include <math.h>
using namespace std;
int main(int argc, char *argv[])
{
int h,m;
double anglehour,angleminute,cavab;
while(cin>>h>>m)
{
if(h==0 && m==0)
break;
anglehour=(60*h+m)*0.5;
angleminute=6*m;
cavab=fabs(anglehour-angleminute);
if(cavab>180)
cavab=360-cavab;
if(m<=9)
{
cout.setf(ios::fixed);
cout.precision(1);
cout<<"At "<<h<<":0"<<m<<" the angle is "<<cavab<<" degrees."<<endl;
}
else
{
cout.setf(ios::fixed);
cout.precision(1);
cout<<"At "<<h<<":"<<m<<" the angle is "<<cavab<<" degrees."<<endl;
}
}
return EXIT_SUCCESS;
}