問題
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用に調整されています。上記の説明と制約に従ってください。