题目描述
Implement a program that can automatically reply based on the received message content, with the following rules:
(1) remove unnecessary spaces in the information: delete the spaces at the beginning and end of the line; Delete excess spaces between adjacent words to one; Delete the space before the punctuation mark.
(2) Change all uppercase English letters in the information to lowercase except for I.
(3) Replace all 'can you' and 'could you' separated by spaces or punctuation marks in the information with 'I can' or 'I could'.
(4) Replace all independent 'I' and 'me' in the information with 'you'.
(5) Replace all '?' to '!'.
Use the converted sentence as an automatic reply
输入格式
First line, give a positive integer N in the first line, and then enter N lines. Each line should contain a non empty string containing only letters, numbers, spaces, and visible half width punctuation, ending with a 'Enter'.
3
Hello ?
can you speak Chinese?
Really?
hello!
I can speak chinese!
really!