520. Detect Capital判断单词有效性】的更多相关文章

[抄题]: Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when one of the following cases holds: All letters in this word are capitals, like "USA". All letter…
Leetcode 520. Detect Capital 发现大写词 (字符串) 题目描述 已知一个单词,你需要给出它是否为"大写词" 我们定义的"大写词"有下面三种情况: 所有字母都是大写,比如"USA" 所有字母都不是大写,比如"leetcode" 只有第一个字母是大写,比如"Google" 测试样例 Input: "USA" Output: True Input: "Fl…
520. Detect Capital Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when one of the following cases holds: All letters in this word are capitals, like "USA&quo…
520. Detect Capital[easy] Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when one of the following cases holds: All letters in this word are capitals, like "U…
problem 520. Detect Capital 题意: 题目中给出的三种情况,分别是全是大写.全是小写.首字母大写,这三种情况返回True;否则返回False; solution: class Solution { public: bool detectCapitalUse(string word) { bool flag = false; ; ; i<word.size(); i++) { char ch = word[i]; if(ch>='A'&&ch<='…
给定一个单词,你需要判断单词的大写使用是否正确.我们定义,在以下情况时,单词的大写用法是正确的:    全部字母都是大写,比如"USA".    单词中所有字母都不是大写,比如"leetcode".    如果单词不只含有一个字母,只有首字母大写, 比如 "Google".否则,我们定义这个单词没有正确使用大写字母.示例 1:输入: "USA"输出: True 示例 2:输入: "FlaG"输出: Fals…
  Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when one of the following cases holds: All letters in this word are capitals, like "USA". All letters in…
题目要求 Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when one of the following cases holds: All letters in this word are capitals, like "USA". All letters…
题目: Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when one of the following cases holds: All letters in this word are capitals, like "USA". All letters…
Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when one of the following cases holds: All letters in this word are capitals, like "USA". All letters in t…