Ultraviolet A 579-clockhands

Source: Internet
Author: User

Clockhands

The medieval interest in mechanical contrivances is well formed strated by the development of the mechanical clock, the oldest of which is driven by weights and controlled by a verge, an Oscillating Arm engaging with a gear wheel. it dates back to 1386.

Clocks driven by springs had appeared by the mid-15th century, making it possible to con-struct more compact mechanisms and preparing the way for the portable clock.

English spring-driven pendulum clocks were first commonly kept on a small wall bracket and later on a shelf. many bracket clocks contained a drawer to hold the Winding Key. the earliest bracket clocks, made for a period after 1660, were of specified tural
Design, with pillars at the sides and a pediment on top.

In 17th-And 18th-century France, the table clock became an object of monumental design, the best examples of which are minor works of sculpture.

The longcase clocks (also called grandfather clocks) are tall pendulum clock enclosed in a wooden case that stands upon the floor and is typically from 6 to 7.5 feet (1.8 to 2.3 m) in height. later, the name ''grandfather clock ''became popular after
Popular Song "my grandfather's clock," written in 1876 by Henry Clay work.

One of the first atomic clocks was an ammonia-controlled clock. it was built in 1949 at the National Bureau of Standards, Washington, D. C .; in this clock the frequency did not vary by more than one part in 108

Nuclear clocks are built using two clocks. the aggregate of atoms that emit the gamma radiation of precise frequency may be called the emitter clock; the group of atoms that absorb this radiation is the absorber clock. one pair of these nuclear clocks can
Detect energy changes of one part in 1014, being about 1,000 times more sensitive than the best atomic clock.

The cesium clock is the most accurate type of clock yet developed. this device makes use of transitions between the spin states of the cesium nucleus us and produces a frequency which is so regular that it has been adopted for establishing the time standard.

The history of clocks is fascinating, but unrelated to this problem. in this problem, you are asked to find the angle between the minute hand the hour hand on a regular analog clock. assume that the second hand, if there were one, wocould be pointing straight
Up at the 12. Give all angles as the smallest positive angles. For example is 90 degrees; not-90 or 270 degrees.

Input

The input is a list of times in the formH:M, Each on their own line,
And
. The input is terminated with the time
0: 00. Note thatHMay be represented with 1 or 2 digits (for 1-9 or 10-12, respectively );
MIs always represented with 2 digits (the input times are what you typically see on a digital clock ).

Output

The output displays the smallest positive angle in degrees between the hands for each time. The answer showould
0Degrees and180Degrees for all input times. display each angle on a line by itself in the same order as the input. the output shoshould be rounded to the nearest 1/1000, I. E ., three places after the decimal point shocould be printed.

Sample Input
12:009:008:100:00

Sample output
0.00090.000175.000

 

# Include <stdio. h>
# Include <math. h>
Void main ()
{Int hour, minute;
Double angle;
While (scanf ("% d: % d", & hour, & minute ))
{If (hour + minute = 0) break;
If (hour> 12) hour-= 12;
Angle = FABS (hour * 30.0 + minute/2.0-6.0 * minute); // If the decimal point is not added, the real number accuracy is incorrect.
If (angle> 180) angle = 360-angle;
Printf ("%. 3lf \ n", angle );
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.