1 solutions

  • 0
    @ 2025-12-15 11:58:22

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    string s,a="apple";
    int main()
    {
    	while(getline(cin,s))
    	{
    		int t=s.find(a);
    		s.replace(t,5,"peach");
    		cout<<s<<endl;	
    	}
    	return 0;
    	 
    }
    
    • 1

    Information

    ID
    1057
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By