ง่าย 0 ข้อที่แก้แล้ว อัตราผ่าน 0%

Initials From a Name

Build uppercase initials from a full name.

โจทย์

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 กรุณาทำตามคำชี้แจงและข้อจำกัดด้านบน

เรียนรู้จากคนอื่น

แนวทางจากชุมชน

ยังไม่มีวิธีทำที่เผยแพร่ ลองแก้โจทย์นี้เพื่อแชร์วิธีแรก