Tous les défis
Facile 0 résolus 0 % de réussite

Initials From a Name

Build uppercase initials from a full name.

Problème

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".

Contraintes

1 ≤ length of full_name ≤ 200; it contains at least one letter

Exemples

Exemple 1
Entrée :
full_name = "Ada Lovelace"

Sortie attendue :
expected = "AL"
Entrée :
std::string full_name = "Ada Lovelace";

Sortie attendue :
std::string expected = "AL";
Entrée :
string full_name = "Ada Lovelace";

Sortie attendue :
string expected = "AL";

Explication

A from Ada and L from Lovelace: "AL".

Exemple 2
Entrée :
full_name = "grace  brewster  hopper"

Sortie attendue :
expected = "GBH"
Entrée :
std::string full_name = "grace  brewster  hopper";

Sortie attendue :
std::string expected = "GBH";
Entrée :
string full_name = "grace  brewster  hopper";

Sortie attendue :
string expected = "GBH";

Explication

Extra spaces don't matter; the initials are uppercased: "GBH".

Références

Ce défi a été adapté pour CodeUtility. Suivez l'énoncé et les contraintes ci-dessus.

Apprenez des autres

Solutions de la communauté

Aucune solution publiée pour l'instant. Résolvez ce défi pour partager la première.