#include &lt;iostream&gt;   #include &lt;string&gt;   using namespace std;   int main &#40;&#41;   &#123;       string str &#40;&quot;nobody does like this&quot;&#41;;       string key &#40;&quot;nobody&quot;&#41;;       size_t f;       f = str.rfind&#40;key&#41;;       if &#40;f != string::npos&#41;           str.replace &#40;f, key.length&#40;&#41;, &quot;everybody&quot;&#41;;       cout &lt;&lt; str &lt;&lt; endl;       return 0;   &#125;
A. nobody does like this
B. nobody
C. everybody
D. everybody does like this
Answer:A
#include &lt;iostream&gt;   #include &lt;string&gt;   using namespace std;   int main &#40;&#41;   &#123;       string str &#40;&quot;nobody does like this&quot;&#41;;       string key &#40;&quot;nobody&quot;&#41;;       size_t f;       f = str.rfind&#40;key&#41;;       if &#40;f != string::npos&#41;           str.replace &#40;f, key.length&#40;&#41;, &quot;everybody&quot;&#41;;       cout &lt;&lt; str &lt;&lt; endl;       return 0;   &#125;
A. nobody does like this B. nobody C. everybody D. everybody does like this
Explanation:rfind is used to find the characters in the string and replace is used to replace with certain characters.