The motion of the hands of a clock is mesmerizing.The second hand revolves once a minute,the minute hand revolves once an hour,and the hour hand revolves once every 12 hours.Have you ever wondered what the exact angles of the hands are at a given tim

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/03 07:27:21
The motion of the hands of a clock is mesmerizing.The second hand revolves once a minute,the minute hand revolves once an hour,and the hour hand revolves once every 12 hours.Have you ever wondered what the exact angles of the hands are at a given tim

The motion of the hands of a clock is mesmerizing.The second hand revolves once a minute,the minute hand revolves once an hour,and the hour hand revolves once every 12 hours.Have you ever wondered what the exact angles of the hands are at a given tim
The motion of the hands of a clock is mesmerizing.The second hand revolves once a minute,the minute hand revolves once an hour,and the hour hand revolves once every 12 hours.Have you ever wondered what the exact angles of the hands are at a given time?
Input
Each line of the input file contains a clock time,expressed in hours,minutes,and seconds.Each number in the time appears in a two column field,separated by single colons.Hours are between 1 and 12,and minutes and seconds are between 0 and 59.
Output
For each time input,Output the time and compute the exact angle of the hour,minute and second hands.Express the angles in degrees clockwise from straight up,at least 0.0 and less than 360.0.Format the output as shown in the sample below.
Sample Input
6:00:00
8:30:00
10:17:55
Sample Output
At 6:00:00...
Hour hand orientation:180.00 degrees,
Minute hand orientation:0.00 degrees,
Second hand orientation:0.00 degrees.
At 8:30:00...
Hour hand orientation:255.00 degrees,
Minute hand orientation:180.00 degrees,
Second hand orientation:0.00 degrees.
At 10:17:55...
Hour hand orientation:308.96 degrees,
Minute hand orientation:107.50 degrees,
Second hand orientation:330.00 degrees.
我的代码:
#include
#include
using namespace std;
int main()
{
int h,m,s;
char ch;
while(cin>>h>>ch>>m>>ch>>s)
{
printf("At %d:%2.2d:%2.2d...\n",h,m,s);
printf(" Hour hand orientation:%.2lf degrees,\n",(double)(h*3600+m*60+s)/(double)(3600*12)*360);
printf("Minute hand orientation:%.2lf degrees,\n",(double)(m*60+s)/(double)(3600)*360);
printf("Second hand orientation:%.2lf degrees.\n\n",(double)s/(double)(60)*360);
}
return 0;
}
#include
#include
using namespace std;
int main()
{
int h,m,s;
char ch;
while(cin>>h>>ch>>m>>ch>>s)
{
printf("At %d:%2.2d:%2.2d...\n",h,m,s);
printf(" Hour hand orientation:%.2lf degrees,\n",30*h+0.5*m+0.5/(double)60*s);
printf("Minute hand orientation:%.2lf degrees,\n",6*m+(double)0.1*s);
printf("Second hand orientation:%.2lf degrees.\n\n",(double)6*s);
}
return 0;
}
二楼这个也不对哈 这个题好像是输出格式问题哈

The motion of the hands of a clock is mesmerizing.The second hand revolves once a minute,the minute hand revolves once an hour,and the hour hand revolves once every 12 hours.Have you ever wondered what the exact angles of the hands are at a given tim
这题的问题是,时针角度要小于360度,你输入 12:00:00就知道问题出在哪了.
另外注意格式.
1361 Accepted 184K 15MS G++ 1.23K
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define Fori(x) for (int i=0; i

Motion of the debate Best Motion Picture of the rt The motion of tuning fork prongs is periodic the motion picture camera是什么意思 决胜时空战区 MASTERS OF THE UNIVERSE THE MOTION PICTURE怎么样 下句中with respect but the motion of one plate with respect to another cannot readily be translated into the motion with respect to the earth's interior. Pieces Of Dreams (From The Motion Picture Pieces Of Dreams) 歌词 Scientists have ____ that motion is the source of lifea、shownb、showedc、been shownd、showing What letter will set one of the heavenly bodies in motion? 这句子怎么翻译?--games are the motion of yourself,you playing youself 功夫片岁月 THE ART OF ACTION MARTIAL ARTS IN MOTION PICTURE怎么样 Television has taken the place of motion picture as America's most popular form of_____.(entertain) 英语翻译Linear movement of conrods is translated into the rotary motion of the crankshaft by a central sliding bearing this was the first discovery of a center of motion not apparently centered on the earth.5082 100402 this was the first discovery of a center of motion not apparently centered on the earth.100402this was the first discovery of a center of motion not apparently centered on the earth.1.this was the first discovery of a center of motion not appa 英语翻译The field of motion capture is rapidly evolving.Every year new systems emerge which offer greater flexibility at lower cost.The price of motion capture has dropped significantly in the past few years as the technology has improved.Previou 英语翻译Conduction is the process of transferring heat through a medium that does not involve appreciable motion of the medium.后半句里面does not involve appreciable motion of the medium这个我不懂啊! a clear majority of voters were in favour of the motion.中文意思 以及clear在句中的意思