1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/计算列车到站时间 [calculate-delayed-arrival-time].html
2023-04-23 22:41:08 +08:00

30 lines
1.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给你一个正整数 <code>arrivalTime</code> 表示列车正点到站的时间(单位:小时),另给你一个正整数 <code>delayedTime</code> 表示列车延误的小时数。</p>
<p>返回列车实际到站的时间。</p>
<p>注意,该问题中的时间采用 24 小时制。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre><strong>输入:</strong>arrivalTime = 15, delayedTime = 5
<strong>输出:</strong>20
<strong>解释:</strong>列车正点到站时间是 15:00 ,延误 5 小时,所以列车实际到站的时间是 15 + 5 = 2020:00
</pre>
<p><strong>示例 2</strong></p>
<pre><strong>输入:</strong>arrivalTime = 13, delayedTime = 11
<strong>输出:</strong>0
<strong>解释:</strong>列车正点到站时间是 13:00 ,延误 11 小时,所以列车实际到站的时间是 13 + 11 = 24在 24 小时制中表示为 00:00 ,所以返回 0</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= arrivaltime &lt;&nbsp;24</code></li>
<li><code>1 &lt;= delayedTime &lt;= 24</code></li>
</ul>