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)/一周中的第几天 [day-of-the-week].html
2022-03-29 12:43:11 +08:00

34 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>给你一个日期,请你设计一个算法来判断它是对应一周中的哪一天。</p>
<p>输入为三个整数:<code>day</code><code>month</code>&nbsp;<code>year</code>,分别表示日、月、年。</p>
<p>您返回的结果必须是这几个值中的一个&nbsp;<code>{&quot;Sunday&quot;, &quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;, &quot;Saturday&quot;}</code></p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre><strong>输入:</strong>day = 31, month = 8, year = 2019
<strong>输出:</strong>&quot;Saturday&quot;
</pre>
<p><strong>示例 2</strong></p>
<pre><strong>输入:</strong>day = 18, month = 7, year = 1999
<strong>输出:</strong>&quot;Sunday&quot;
</pre>
<p><strong>示例 3</strong></p>
<pre><strong>输入:</strong>day = 15, month = 8, year = 1993
<strong>输出:</strong>&quot;Sunday&quot;
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li>给出的日期一定是在&nbsp;<code>1971</code>&nbsp;<code>2100</code>&nbsp;年之间的有效日期。</li>
</ul>