题目描述
"As we all know, strings are often encountered in ACM competitions, so this question is about strings. "
On this day, Xiaoming received Xiaohong's letter, but unfortunately, before that, Xiaoming expressed his love to Xiaohong. This letter obviously came to refuse Xiaoming. The letter wrote many words in the form of "dontlike", "hate", but Xiao Ming liked them after all, so he decided to replace "dontlike" with "like", "hate" with "love", "dislike" with "like" and "distinguishing" with"exciting" in all of this letter.
输入描述:
The first line contains one number n, idicates the length of the letter. (1 <= n <=10000)
The second line contains string s.
输出描述:
Output the replaced result.
示例1
输入
8
ihateyou
输出
iloveyou
letter_transfer={
'dontlike':'like',
'hate':'love',
'dislike':'like',
'distinguishing':'exciting'
}
n=int( input('请输入字符串的长度n,(1 <= n <=10000): ') )
s=input('请输入字符串: ')
if len(s) == n:
for k,v in letter_transfer.items():
if k in s:
s = s.replace(k,v)
print(s)
continue