Exerpad
🔥0
0 XP
Lv.1 Beginner
Log In

Initials

Read a first name and a last name (one per line) and print the person's initials in uppercase.

Print the initials with dots, like A.B..

Example: If the user types Alice and then Baker, your program should print A.B..

Hint: You can get the first character of a string with .chars().next().unwrap() and convert it to uppercase with .to_uppercase(). You'll need to collect the uppercase result — try using for c in ch.to_uppercase() { print!("{}.", c); } and then println!() at the end.

rust
fn main() {
}