Given the start time and end time of a contest. Please calculate the amount of time for the contest.
The first line contains three integers $h_{st},\ m_{st},\ s_{st}\ (0\leq h_{st}<24,\ 0\leq m_{st},\ s_{st}<60)$, representing the start time of a contest.
The second line contains three integers $h_{ed},\ m_{ed},\ s_{ed}\ (0\leq h_{ed}<24,\ 0\leq m_{ed},\ s_{ed}<60)$, representing the end time of the contest.
It is guaranteed that the start time must be earlier than the end time.
One line contains three integers $h_{tot}\ m_{tot}\ s_{tot}$ - the amount of time for the contest.
The three integers must be in the ranges: $0 \leq h_{tot} < 24,\ 0 \leq m_{tot}, s_{tot} < 60$.
If any of the above integers has less than $2$ digits, fill in the prefix $0$. Please see the hint provided below.
Consider that $n=3$.
You can use
cout << setw(2) << setfill('0') << n;
to fill in the prefix $0$ if $n$ has less than $2$ digits.
That is, it prints out $03$.
Remember to add #include <iomanip>
before you use setw()
and setfill()
.
No. | Testdata Range | Score |
---|---|---|
1 | 0~9 | 100 |
No. | Time Limit (ms) | Memory Limit (KiB) | Output Limit (KiB) | Subtasks |
---|---|---|---|---|
0 | 1000 | 65536 | 65536 | |
1 | 1000 | 65536 | 65536 | |
2 | 1000 | 65536 | 65536 | |
3 | 1000 | 65536 | 65536 | |
4 | 1000 | 65536 | 65536 | |
5 | 1000 | 65536 | 65536 | |
6 | 1000 | 65536 | 65536 | |
7 | 1000 | 65536 | 65536 | |
8 | 1000 | 65536 | 65536 | |
9 | 1000 | 65536 | 65536 |