cswork / OA打开练习工作台

MetaOA #22

Replace Every Nth Consonant

估计简单可在线判题

考点(AI 标注)字符串

Count the consonants among the English letters from left to right, and replace every n-th consonant with the next consonant in alphabetical order, preserving case; z/Z wraps around to b/B. The consonant order is bcdfghjklmnpqrstvwxyz. Vowels, spaces, digits, and punctuation are not counted and are left unchanged.

输入格式

This site's input: the first line contains n (1..100000), and the second line is printable ASCII text of length 0..100000, which may contain leading, trailing, and consecutive spaces.

输出格式

Output the complete text after replacement, keeping all spaces and case, and end it with a single newline.

样例 1

输入:

3
CodeSignal

输出:

CodeTignam

样例 2

输入:

1
z Z!

输出:

b B!

样例 3

输入:

2
  a   b  

输出:

  a   b  

样例说明

Example 1: the consonants in order are C, d, S, g, n, l; the 3rd, S, becomes T, and the 6th, l, becomes m, giving CodeTignam.

Example 2: every consonant is replaced; z wraps to b and Z wraps to B, so the output is b B!.

Example 3: there is only one consonant, b, so the 2nd is never reached, and the whole line, including all spaces, is output unchanged.