#317. 字符串模式匹配与修改

    ID: 317 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatString-2gesp3字符串循环结构

字符串模式匹配与修改

String Pattern Modification

Background

This problem involves processing a given string based on specific patterns.

Problem Description

Look for patterns like "zip" and "zap" in the string – these are length-3 substrings that start with 'z' and end with 'p'. Return a string where for all such words, the middle letter is removed. For example, "zipXzap" yields "zpXzp".

Input Format

Input is given from standard input in the following format.

s

Output Format

Output is printed to standard output in the following format.

modified_s

Sample

zipXzap
"zpXzp"
zopzop
"zpzp"
zzzopzop
"zzzpzp"

Sample Explanation

For the input "zipXzap\