Problem
Übersetzung anzeigenTake 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".
Einschränkungen
1 ≤ length of full_name ≤ 200; it contains at least one letter
Beispiele
Eingabe:
full_name = "Ada Lovelace"
Erwartete Ausgabe:
expected = "AL"
Eingabe:
std::string full_name = "Ada Lovelace";
Erwartete Ausgabe:
std::string expected = "AL";
Eingabe:
string full_name = "Ada Lovelace";
Erwartete Ausgabe:
string expected = "AL";
Erläuterung
A from Ada and L from Lovelace: "AL".
Eingabe:
full_name = "grace brewster hopper"
Erwartete Ausgabe:
expected = "GBH"
Eingabe:
std::string full_name = "grace brewster hopper";
Erwartete Ausgabe:
std::string expected = "GBH";
Eingabe:
string full_name = "grace brewster hopper";
Erwartete Ausgabe:
string expected = "GBH";
Erläuterung
Extra spaces don't matter; the initials are uppercased: "GBH".
Referenzen
Diese Aufgabe wurde für CodeUtility angepasst. Beachte die oben genannten Vorgaben und Einschränkungen.