More Exercise: Extract Person Information
Здравейте колеги,
нулевите тестове минават и от там нататък нито един тест не минава...
Кодът: https://pastebin.com/EQvUByki
Условието:
Write a program that reads N lines of strings and extracts the name and age of a given person. The name of the person will be between '@' and '|'. The person’s age will be between '#' and '*'. Example: "Hello my name is @Peter| and I am #20* years old." For each found name and age print a line in the following format "{name} is {age} years old."
Example
Input |
Output |
2 Here is a name @George| and an age #18* Another name @Billy| #35* is his age |
George is 18 years old. Billy is 35 years old. |
3 random name @lilly| random digits 5* age @Marry| with age #19* here Comes @Garry| he is #48* years old |
lilly is 5 years old. Marry is 19 years old. Garry is 48 years old. |
Много елегантно решение. Благодаря svephoto!
Моля!