Problema
Ver traduçãoTake 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".
Restrições
1 ≤ length of full_name ≤ 200; it contains at least one letter
Exemplos
Entrada:
full_name = "Ada Lovelace"
Saída esperada:
expected = "AL"
Entrada:
std::string full_name = "Ada Lovelace";
Saída esperada:
std::string expected = "AL";
Entrada:
string full_name = "Ada Lovelace";
Saída esperada:
string expected = "AL";
Explicação
A from Ada and L from Lovelace: "AL".
Entrada:
full_name = "grace brewster hopper"
Saída esperada:
expected = "GBH"
Entrada:
std::string full_name = "grace brewster hopper";
Saída esperada:
std::string expected = "GBH";
Entrada:
string full_name = "grace brewster hopper";
Saída esperada:
string expected = "GBH";
Explicação
Extra spaces don't matter; the initials are uppercased: "GBH".
Referências
Este desafio foi adaptado para o CodeUtility. Siga o enunciado e as restrições acima.