menu ZJOJ
account_circle 请登录
home
首页
book
题目
apps
分类
play_circle_outline
状态
assessment
竞赛
assignment
作业
equalizer
排名
assignment_ind
登录
person_add
注册
1540: Auto Reply
时间限制:1.000s
内存限制:128MB

题目描述

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'.

输出格式

Output right reply

样例输入 content_copy

3
Hello ?
can you speak Chinese?
Really?

样例输出 content_copy

hello!
I can speak chinese!
really!

分类