#abc286b. B - Cat
B - Cat
Score : points
问题描述
你将得到一个长度为 的字符串 。
要求你在字符串 中,将所有连续出现的 na
替换为 nya
,并找出替换后的字符串。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given a string of length .
Find the string obtained by replacing all contiguous occurrences of na
in with nya
.
Constraints
- is an integer between and , inclusive.
- is a string of length consisting of lowercase English letters.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
4
naan
Sample Output 1
nyaan
Replacing all contiguous occurrences of na
in naan
with nya
results in the string nyaan
.
Sample Input 2
4
near
Sample Output 2
near
may not contain a contiguous na
.
Sample Input 3
8
national
Sample Output 3
nyationyal
update @ 2024/3/10 11:57:03