문제
Take the first letter of each word in full_name, uppercase it, and join the letters. Words are separated by one or more spaces.
Implement initials(full_name).
Input
full_name: A name made of letters and spaces.
Output
Return the initials, for example "ADL".
제약 조건
1 ≤ length of full_name ≤ 200; it contains at least one letter
예시
예시 1
입력:
full_name = "Ada Lovelace"
예상 출력:
expected = "AL"
입력:
std::string full_name = "Ada Lovelace";
예상 출력:
std::string expected = "AL";
입력:
string full_name = "Ada Lovelace";
예상 출력:
string expected = "AL";
설명
A from Ada and L from Lovelace: "AL".
예시 2
입력:
full_name = "grace brewster hopper"
예상 출력:
expected = "GBH"
입력:
std::string full_name = "grace brewster hopper";
예상 출력:
std::string expected = "GBH";
입력:
string full_name = "grace brewster hopper";
예상 출력:
string expected = "GBH";
설명
Extra spaces don't matter; the initials are uppercased: "GBH".
참고 자료
이 문제는 CodeUtility에 맞게 수정되었습니다. 위의 설명과 제한 조건을 따르세요.