mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-13 19:31:42 +08:00
add leetcode problem-cn part5
This commit is contained in:
34
算法题(国内版)/problem (Chinese)/检测大写字母 [detect-capital].html
Normal file
34
算法题(国内版)/problem (Chinese)/检测大写字母 [detect-capital].html
Normal file
@@ -0,0 +1,34 @@
|
||||
<p>我们定义,在以下情况时,单词的大写用法是正确的:</p>
|
||||
|
||||
<ul>
|
||||
<li>全部字母都是大写,比如 <code>"USA"</code> 。</li>
|
||||
<li>单词中所有字母都不是大写,比如 <code>"leetcode"</code> 。</li>
|
||||
<li>如果单词不只含有一个字母,只有首字母大写, 比如 <code>"Google"</code> 。</li>
|
||||
</ul>
|
||||
|
||||
<p>给你一个字符串 <code>word</code> 。如果大写用法正确,返回 <code>true</code> ;否则,返回 <code>false</code> 。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>word = "USA"
|
||||
<strong>输出:</strong>true
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>word = "FlaG"
|
||||
<strong>输出:</strong>false
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>1 <= word.length <= 100</code></li>
|
||||
<li><code>word</code> 由小写和大写英文字母组成</li>
|
||||
</ul>
|
Reference in New Issue
Block a user