-->
当前位置:首页 > 题库

PROGRAMMING:AI core code valued at 100 million

Luz5年前 (2021-05-10)题库386

The above pictures are from Sina Weibo.
This question requires you to implement a slightly more valuable AI English Q & a program
-No matter what the user says, first print out what the other party says in one line;
-Eliminate redundant spaces in the original text: replace multiple spaces between adjacent words with one space, delete all the spaces at the beginning and end of the line, and delete the spaces in front of punctuation marks;
-Change all uppercase English letters into lowercase, except 'I';
-Replace all the independent 'can you' and 'could you' in the original text with 'I can' and 'I could' - here "independence" refers to the words separated by spaces or punctuation marks;
-Replace all the independent 'I' and 'me' with 'you';
-Put all the question marks in the original text` Change to exclamation mark '!';
-Output the replaced sentence in one line as the answer of AI.
###Input format:
Input: first, give a positive integer n of no more than 10 in the first line, and then n lines. Each line gives a user's dialogue of no more than 1000 characters ending with carriage return. The dialogue is a non empty string, including only letters, numbers, spaces and visible half width punctuation.
###Output format:
Output according to the requirements of the question, and add 'AI:' and a space before each AI answer.
###Input example:
```in
six
Hello ?
Good to chat with you
can you speak Chinese?
Really?
Could you show me 5
What Is this prime? I,don 't know
```
###Output example:
```out
Hello ?
AI: hello!
Good to chat with you
AI: good to chat with you
can you speak Chinese?
AI: I can speak chinese!
Really?
AI: really!
Could you show me 5
AI: I could show you 5
What Is this prime? I,don 't know
AI: what Is this prime! you,don't know
```







answer:If there is no answer, please comment