#C13540. Email Generation
Email Generation
Email Generation
You are given a list of full names. For each name, you must generate an email address according to the following rules:
- Convert the entire name to lowercase.
- Remove all spaces from the name.
- Append the domain
@example.com
.
For example, the name John Doe will be converted to johndoe@example.com
.
Note: When processing the input, all extra spaces (including leading, trailing, or between words) should be removed.
The email transformation can be expressed mathematically as follows:
\[ email = \text{lowercase}(\text{removeSpaces}(name)) + "@example.com" \]
inputFormat
The input is read from standard input and begins with an integer N
representing the number of names. This is followed by N
lines, each containing one full name, which may include extra spaces and mixed cases.
outputFormat
Output the generated email addresses, one per line, in the same order as the input. Each email address should be in lowercase, with all spaces removed, and appended with @example.com
.
4
John Doe
Jane Smith
Alice Johnson
Chris Lee
johndoe@example.com
janesmith@example.com
alicejohnson@example.com
chrislee@example.com
</p>