编程介的小学生 2019-06-07 09:30 采纳率: 20.5%
浏览 169

计算时钟可以表示的时间的不同种类的个数,用C语言的程序代码编写的程序的方式的实现怎么做

Problem Description

There is only one Big Clock in the Alibaba’s headquarters on Mars. Since it is on Mars, the Clock is different as it was on Earth.
There are A hours per day and B minutes per hour. The Clock has two hands, the hour hand and the minute hand. The hour hand travels 360 degrees per day and the minute hand travels 360 degrees per hour. Both hands travel consecutively.
But for some reason, the Clock is not very steady. One day the Clock drops off the wall, but fortunately, it is still working. So they plans to put it back onto the wall. But they soon found a problem: it’s the only clock they have, so they don’t know the current time now. Clock only shows the relative position between the two hands, but doesn’t show how to place it (as there are no marks on it), so it can be rotated and represent several different times.
They want your help to determine how many different times the clock may represent.

Input
The input consists several testcases.
Every test case only contains one line with two integers A, B (1 <= A,B <= 109) and a real number θ (0 < θ < 2 π), means that there are A hours per day and B minutes per hour, and the minute hand is θ rad ahead of the hour hand)
Input ends with one line containing “0 0 0”.

Output
Print one integer, the number of different times the clock may represent.

Sample Input
1 1 1.57
0 0 0

Sample Output
0

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥15 c++头文件不能识别CDialog