P27032 [AtCoder] Replace All Characters Except the K-th One
入门
题目描述

Problem Description

You are given a string $ S $ of length $ N $ consisting of lowercase English letters and an integer $ K $. Output the string obtained by replacing all characters in $ S $ that are different from the $ K $-th character with *.

Input Format

The input is given from the standard input in the following format:

$ N $ $ S $ $ K $

Output Format

Output the string obtained by replacing all characters in $ S $ that are different from the $ K $-th character with *.

Sample Input and Output

Sample Input #1

5
error
2

Sample Output #1

*rr*r

Sample Input #2

6
eleven
5

Sample Output #2

e*e*e*

Sample Input #3

9
education
7

Sample Output #3

******i**

Notes/Hints

Constraints

  • $1 \leq K \leq N \leq 10$
  • $ S $ is a string of length $ N $ consisting of lowercase English letters.
  • $ N $ and $ K $ are integers.

Sample Explanation 1

The $ 2 $-th character of $ S $ is r, and replacing all characters in error that are different from r with * results in the string *rr*r.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
5 error 2
样例输出
*rr*r