/* * ========================================================================= * * FileName: leetcode_520.cpp * * Description: * * Version: 1.0 * Created: 2018-11-28 15:06:45 * Last Modified: 2018-11-28 15:06:59 * Revision: none * Compiler: gcc * * Author: zt () * Organization: * * ========================================================================= */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; bool detectCapitalUse ( string word ) { string up = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string low = "abcdefghijklmnopqrstuvwxyz"; if ( word.find_first_of ( low ) == string::npos || word.find_first_of ( up ) == string::npos ) return true; if ( up.find ( word.front() ) != string::npos ) { word.erase ( 0, 1 ); if ( word.find_first_of ( up ) == string:: npos ) return true; } return false; } int main ( int argc, char* argv[] ) { ( void ) argc; ( void ) argv; return 0; }