In the first years following the French Revolution, intellectuals were set to outroot the society from the traditions and superstitions the dark ages of the royalty. Some of these contributions have had a worldwide success, such as the metric system. Others have falled into (almost) complete oblivion, such as the decimal clock system, invented by the mathematician Gilbert Romme. The decimal clock system divides the day in 10 decimal hours, themselves divided in 100 decimal minutes, themselves divided into 100 decimal seconds.
You are commissioned by the international watch maker “Splatch” to include yet another useless feature in their next line of product: decimal time display. Your first task will be to implement a program that converts a traditional time into a decimal time at the precision of one-hundredth of second.
Input
The input consists of a sequence of lines, each containing exactly one traditional time, in the format HHMMSSCC, where 0 ≤ HH ≤ 23, 0 ≤ MM ≤ 59, 0 ≤ SS ≤ 59 and 0 ≤ CC ≤ 99. The input is terminated with an end-of-file.
Output
For each given traditional time, the output will echo a line with the corresponding decimal time, rounded by truncation, in the format HMMSSCC, where 0 ≤ H ≤ 9, 0 ≤ MM ≤ 99, 0 ≤ SS ≤ 99 and 0 ≤ CC ≤ 99.
Sample Input
00000000
23595999
12000000
14273467
02475901
Sample Output
0000000
9999998
5000000
6024846
1166552
问题链接:UVA10683 The decadary watch
问题简述:(略)
问题分析:
将24小时制时间转化成10进制时间。
简单题不解释。数据输入格式值得推荐。
程序说明:(略)
参考链接:(略)
题记:(略)
AC的C++语言程序如下:
/* UVA10683 The decadary watch */
#include <bits/stdc++.h>
using namespace std;
const double RATE = 10000000.0 / (24 * 3600 * 100);
int main()
{
int hh, mm, ss, cc;
while(~scanf("%2d%2d%2d%2d", &hh, &mm, &ss, &cc))
printf("%07d\n", (int)((((hh * 60 + mm) * 60 + ss) * 100 + cc) * RATE));
return 0;
}