{"id":4039,"date":"2023-11-03T11:16:27","date_gmt":"2023-11-03T03:16:27","guid":{"rendered":"https:\/\/white-night.club\/?p=4039"},"modified":"2023-11-09T11:07:43","modified_gmt":"2023-11-09T03:07:43","slug":"ad124","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/11\/03\/ad124\/","title":{"rendered":"520.\u00a0\u68c0\u6d4b\u5927\u5199\u5b57\u6bcd"},"content":{"rendered":"\n<p>\u6211\u4eec\u5b9a\u4e49\uff0c\u5728\u4ee5\u4e0b\u60c5\u51b5\u65f6\uff0c\u5355\u8bcd\u7684\u5927\u5199\u7528\u6cd5\u662f\u6b63\u786e\u7684\uff1a<\/p>\n\n\n\n<ul>\n<li>\u5168\u90e8\u5b57\u6bcd\u90fd\u662f\u5927\u5199\uff0c\u6bd4\u5982&nbsp;<code>\"USA\"<\/code>&nbsp;\u3002<\/li>\n\n\n\n<li>\u5355\u8bcd\u4e2d\u6240\u6709\u5b57\u6bcd\u90fd\u4e0d\u662f\u5927\u5199\uff0c\u6bd4\u5982&nbsp;<code>\"leetcode\"<\/code>&nbsp;\u3002<\/li>\n\n\n\n<li>\u5982\u679c\u5355\u8bcd\u4e0d\u53ea\u542b\u6709\u4e00\u4e2a\u5b57\u6bcd\uff0c\u53ea\u6709\u9996\u5b57\u6bcd\u5927\u5199\uff0c&nbsp;\u6bd4\u5982&nbsp;<code>\"Google\"<\/code>&nbsp;\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u7ed9\u4f60\u4e00\u4e2a\u5b57\u7b26\u4e32&nbsp;<code>word<\/code>&nbsp;\u3002\u5982\u679c\u5927\u5199\u7528\u6cd5\u6b63\u786e\uff0c\u8fd4\u56de&nbsp;<code>true<\/code>&nbsp;\uff1b\u5426\u5219\uff0c\u8fd4\u56de&nbsp;<code>false<\/code>&nbsp;\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b 1\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>\u8f93\u5165\uff1a<\/strong>word = \"USA\"\n<strong>\u8f93\u51fa\uff1a<\/strong>true\n<\/pre>\n\n\n\n<p><strong>\u793a\u4f8b 2\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>\u8f93\u5165\uff1a<\/strong>word = \"FlaG\"\n<strong>\u8f93\u51fa\uff1a<\/strong>false\n<\/pre>\n\n\n\n<p><strong>\u63d0\u793a\uff1a<\/strong><\/p>\n\n\n\n<ul>\n<li><code>1 &lt;= word.length &lt;= 100<\/code><\/li>\n\n\n\n<li><code>word<\/code>&nbsp;\u7531\u5c0f\u5199\u548c\u5927\u5199\u82f1\u6587\u5b57\u6bcd\u7ec4\u6210<\/li>\n<\/ul>\n\n\n\n<div style=\"height:60px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<blockquote class=\"wp-block-quote has-luminous-vivid-amber-color has-text-color\">\n<p>\u89e3\u9898\u601d\u8def<\/p>\n<cite><em>isupper\uff0cislower<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u76f4\u63a5\u8c03\u51fd\u6570\u5224\u65ad\u5457\uff0c\u4e0d\u8fc7\u5728\u8bc4\u8bba\u533a\u770b\u5230\u6709\u7528\u4f4d\u8fd0\u7b97\u7684\uff0c\u786e\u5b9e\u6ca1\u60f3\u5230\u3002\u5230\u65f6\u5019\u6709\u65f6\u95f4\u8fd8\u5f97\u770b\u770b\u4f4d\u8fd0\u7b97\u7684\u76f8\u5173\u77e5\u8bc6\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class Solution {\r\npublic:\r\n    bool detectCapitalUse(string word) {\r\n        if(isupper(word&#91;0]))\r\n        {\r\n           bool flag=false;\r\n           for(int i=1;i&lt;word.length();i++)\r\n           {\r\n               if(isupper(word&#91;1]))\r\n                   flag=true;\r\n               if(flag==true&amp;&amp;islower(word&#91;i]))\r\n                   return false;\r\n               if(flag==false&amp;&amp;isupper(word&#91;i]))\r\n                   return false;\r\n           }\r\n           return true;\r\n        }else\r\n        {\r\n            for(int i=1;i&lt;word.length();i++)\r\n                if(isupper(word&#91;i]))\r\n                    return false;\r\n            return true;\r\n        }\r\n    }\r\n};<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Leetcode\u9898\u76ee\uff1aisupper\uff0cislower<\/p>\n","protected":false},"author":1,"featured_media":2827,"comment_status":"open","ping_status":"","sticky":false,"template":"base","format":"standard","meta":{"footnotes":""},"categories":[42,25],"tags":[38],"_links":{"self":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/4039"}],"collection":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/comments?post=4039"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/4039\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media\/2827"}],"wp:attachment":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media?parent=4039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=4039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=4039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}