#include <bits/stdc++.h>
using namespace std;
string replacePi(string s)
{
if (s.size() <= 1)
{
return s;
}
if (s.substr(0, 2) == "pi")
{
string ros = replacePi(s.substr(2));
return "3.14" + ros;
}
string ros = replacePi(s.substr(1));
return s[0] + ros;
}
int main()
{
int testCases;
cin >> testCases;
while (testCases–)
{
string s;
cin >> s;
cout << replacePi(s) << endl;
}
return 0;
}
sir i cannot understand this code and why do we wright s[0] what is the use of it