[Offer收割]编程练习赛24 register

Ended

Participants:356

Verdict:Accepted
Score:100 / 100
Submitted:2017-08-27 12:21:45

Lang:G++

Edit
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
/*
* @Author: wind
* @Date:   2017-08-27 12:01:21
* @Last Modified by:   wind
* @Last Modified time: 2017-08-27 12:21:40
*/
#include <iostream>
#include <vector>
#include <stdio.h>
using namespace std;
struct Time
{
    int h;
    int m;
    int s;
    double angle;
    Time() {}
    Time(const int h, const int m, const int s) : h(h), m(m), s(s)
    {
        double hour_hand = (h * 3600 + m * 60 + s) / double(12 * 3600);
        double miniute_hand = (m * 60 + s) / double(3600);
        // cout << "hour_hand = " << hour_hand << ", miniute_hand = " << miniute_hand << endl;
        angle = 360 * (hour_hand - miniute_hand);
        if (angle < 0)
        {
            angle += 360.0;
        }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX