Dễ 0 đã giải Tỷ lệ chấp nhận 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".

Ràng buộc

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

Ví dụ

Ví dụ 1
Đầu vào:
full_name = "Ada Lovelace"

Kết quả mong đợi:
expected = "AL"
Đầu vào:
std::string full_name = "Ada Lovelace";

Kết quả mong đợi:
std::string expected = "AL";
Đầu vào:
string full_name = "Ada Lovelace";

Kết quả mong đợi:
string expected = "AL";

Giải thích

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

Ví dụ 2
Đầu vào:
full_name = "grace  brewster  hopper"

Kết quả mong đợi:
expected = "GBH"
Đầu vào:
std::string full_name = "grace  brewster  hopper";

Kết quả mong đợi:
std::string expected = "GBH";
Đầu vào:
string full_name = "grace  brewster  hopper";

Kết quả mong đợi:
string expected = "GBH";

Giải thích

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

Tham khảo

Thử thách này đã được điều chỉnh cho CodeUtility. Hãy làm theo đề bài và các ràng buộc ở trên.

Học hỏi từ người khác

Giải pháp cộng đồng

Chưa có giải pháp nào được chia sẻ. Hãy giải thử thách này để đăng giải pháp đầu tiên.