आसान 0 हल किए गए 0% स्वीकृति

Title Case

Capitalize the first letter of every word.

Convert text to title case: the first letter of every word becomes uppercase and the remaining letters lowercase. Words are separated by single spaces.

Implement title_case(text).

Input

text: Lowercase or mixed-case words separated by single spaces.

Output

Return the title-cased text.

सीमाएँ

0 ≤ length ≤ 10,000 (letters and spaces)

उदाहरण

उदाहरण 1
इनपुट:
text = "hello world"

अपेक्षित आउटपुट:
expected = "Hello World"
इनपुट:
std::string text = "hello world";

अपेक्षित आउटपुट:
std::string expected = "Hello World";
इनपुट:
string text = "hello world";

अपेक्षित आउटपुट:
string expected = "Hello World";

व्याख्या

"hello" → "Hello" and "world" → "World".

उदाहरण 2
इनपुट:
text = "tHE qUICK fox"

अपेक्षित आउटपुट:
expected = "The Quick Fox"
इनपुट:
std::string text = "tHE qUICK fox";

अपेक्षित आउटपुट:
std::string expected = "The Quick Fox";
इनपुट:
string text = "tHE qUICK fox";

अपेक्षित आउटपुट:
string expected = "The Quick Fox";

व्याख्या

Remaining letters become lowercase: "The Quick Fox".

संदर्भ

यह चुनौती CodeUtility के लिए अनुकूलित की गई है। ऊपर दिए गए स्टेटमेंट और सीमाओं का पालन करें।

दूसरों से सीखें

समुदाय समाधान

अभी तक कोई प्रकाशित समाधान नहीं। पहला साझा करने के लिए इस चुनौती को हल करें।