#215. 递归替换字符串中的"pi"

    ID: 215 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatWarmup-2gesp5递归字符串

递归替换字符串中的"pi"

Replace "pi"

Background

Congcong is currently learning about string processing. He encountered an interesting problem that requires replacing a specific pattern within a string.

Problem Description

Given a string, compute recursively (no loops) a new string where all appearances of "pi" have been replaced by "3.14".

Input Format

Input is given from standard input in the following format.

[Input string]

Output Format

Output is printed to standard output in the following format.

[Output string]

Sample

xpix
"x3.14x"
pipi
"3.143.14"
pip
"3.14p"

Constraints

Time limit: 1 second, Memory limit: 1024 KiB for each test case.