Условие
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. Следуйте условию и ограничениям выше.