쉬움 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에 맞게 수정되었습니다. 위의 설명과 제한 조건을 따르세요.

다른 사람의 풀이 보기

커뮤니티 솔루션

아직 공개된 풀이가 없습니다. 문제를 풀고 첫 풀이를 공유하세요.